changeset 94:de18d1ac7d34

add some testing of arithmetic
author David A. Holland
date Mon, 10 Jun 2013 23:23:01 -0400
parents da557b87be61
children 1c0575f7dd46
files tests/Makefile tests/t24.c tests/t24.good
diffstat 3 files changed, 73 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/tests/Makefile	Mon Jun 10 23:22:52 2013 -0400
+++ b/tests/Makefile	Mon Jun 10 23:23:01 2013 -0400
@@ -3,7 +3,7 @@
 
 TESTS=\
 	t01 t02 t03 t04 t05 t06 t07 t08 t09 t10 t11 t12 t13 t14 t15 t16 \
-	t17 t18 t19 t20 t21 t22 t23
+	t17 t18 t19 t20 t21 t22 t23 t24
 
 all: run-tests .WAIT show-diffs
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/t24.c	Mon Jun 10 23:23:01 2013 -0400
@@ -0,0 +1,67 @@
+#if 0
+wrong
+#endif
+
+#if 1
+right
+#endif
+
+#if -1
+right
+#endif
+
+#if 0 + 0
+wrong
+#endif
+
+#if 1 + 1
+right
+#endif
+
+#if 1 - 1
+wrong
+#endif
+
+#if -1 + 1
+wrong
+#endif
+
+#if 3 - 2 - 1
+wrong
+#endif
+
+#if 3 * 2 - 6
+wrong
+#endif
+
+#if 6 - 2 * 3
+wrong
+#endif
+
+#if 3 - 3 && 1
+wrong
+#endif
+
+#if 3 - 3 || 0
+wrong
+#endif
+
+#if 1 && 0
+wrong
+#endif
+
+#if 0 && 1
+wrong
+#endif
+
+#if 1 || 0
+right
+#endif
+
+#if 0 || 1
+right
+#endif
+
+#if (0 || 1) && (0 || 0)
+wrong
+#endif
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/t24.good	Mon Jun 10 23:23:01 2013 -0400
@@ -0,0 +1,5 @@
+right
+right
+right
+right
+right