]> pd.if.org Git - lice/blobdiff - tests/compare.c
autocommit for files dated 2014-11-17 20:13:34
[lice] / tests / compare.c
diff --git a/tests/compare.c b/tests/compare.c
new file mode 100644 (file)
index 0000000..8ec4f97
--- /dev/null
@@ -0,0 +1,34 @@
+// comparison
+
+int main(void) {
+    expecti(1 < 2,  1);
+    expecti(1 > 2,  0);
+    expecti(1 == 1, 1);
+    expecti(1 == 2, 0);
+    expecti(1 <= 2, 1);
+    expecti(2 <= 2, 1);
+    expecti(2 <= 1, 0);
+    expecti(1 >= 2, 0);
+    expecti(2 >= 2, 1);
+    expecti(2 >= 1, 1);
+    expecti(1 != 1, 0);
+    expecti(1 != 0, 1);
+    expecti(1.0f == 1.0f, 1);
+    expecti(1.0f == 2.0f, 0);
+    expecti(1.0f != 1.0f, 0);
+    expecti(1.0f != 2.0f, 1);
+    expecti(1.0  == 1.0f, 1);
+    expecti(1.0  == 2.0f, 0);
+    expecti(1.0  != 1.0f, 0);
+    expecti(1.0  != 2.0f, 1);
+    expecti(1.0f == 1.0,  1);
+    expecti(1.0f == 2.0,  0);
+    expecti(1.0f != 1.0,  0);
+    expecti(1.0f != 2.0,  1);
+    expecti(1.0  == 1.0,  1);
+    expecti(1.0  == 2.0,  0);
+    expecti(1.0  != 1.0,  0);
+    expecti(1.0  != 2.0,  1);
+
+    return 0;
+}