aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/test_if_else.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_if_else.sh')
-rw-r--r--tests/test_if_else.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/test_if_else.sh b/tests/test_if_else.sh
new file mode 100644
index 0000000..cad1716
--- /dev/null
+++ b/tests/test_if_else.sh
@@ -0,0 +1,20 @@
+test_exit_code 12 <<'EOF'
+int main() {
+ if (1) {
+ return 12;
+ } else {
+ return 34;
+ }
+}
+EOF
+
+test_exit_code 34 <<'EOF'
+int main() {
+ if (1 + 1 != 2) {
+ return 12;
+ } else {
+ return 34;
+ }
+}
+EOF
+