summaryrefslogtreecommitdiff
path: root/examples/conditionals.fy
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2008-05-15 23:28:07 +0000
committerPaul Buetow <paul@buetow.org>2008-05-15 23:28:07 +0000
commitbe839900419c7a74c4a46efd279d0ca16b35dc1f (patch)
tree1355c8f238d1c58ffd5cb8803bcc2adf987e79aa /examples/conditionals.fy
parent33c945e58f86267b0d3bdca4c3421155e11eb0d9 (diff)
Moved stuff into trunk.
Diffstat (limited to 'examples/conditionals.fy')
-rw-r--r--examples/conditionals.fy41
1 files changed, 41 insertions, 0 deletions
diff --git a/examples/conditionals.fy b/examples/conditionals.fy
new file mode 100644
index 0000000..1260ae2
--- /dev/null
+++ b/examples/conditionals.fy
@@ -0,0 +1,41 @@
+#*
+ * Simple conditional tests
+ *#
+
+# "0010\n"
+assert 0 == (put 1 < 1);
+assert 0 == (put 1 < 0);
+assert 1 == (put 0 < 1);
+assert 0 == (say 0 < 0);
+
+# "0100\n"
+assert 0 == (put 1 > 1);
+assert 1 == (put 1 > 0);
+assert 0 == (put 0 > 1);
+assert 0 == (say 0 > 0);
+
+# "1001\n"
+assert 1 == (put 1 == 1);
+assert 0 == (put 1 == 0);
+assert 0 == (put 0 == 1);
+assert 1 == (say 0 == 0);
+
+# "0110\n"
+assert 0 == (put 1 != 1);
+assert 1 == (put 1 != 0);
+assert 1 == (put 0 != 1);
+assert 0 == (say 0 != 0);
+
+# "1011\n"
+assert 1 == (put 1 <= 1);
+assert 0 == (put 1 <= 0);
+assert 1 == (put 0 <= 1);
+assert 1 == (say 0 <= 0);
+
+## "1101\n"
+assert 1 == (put 1 >= 1);
+assert 1 == (put 1 >= 0);
+assert 0 == (put 0 >= 1);
+assert 1 == (say 0 >= 0);
+
+