summaryrefslogtreecommitdiff
path: root/regress
diff options
context:
space:
mode:
authorOtto Moerbeek <otto@cvs.openbsd.org>2003-11-14 20:27:18 +0000
committerOtto Moerbeek <otto@cvs.openbsd.org>2003-11-14 20:27:18 +0000
commitfacfa9ebaddcd6343c58e5546e9c221ab0da11f4 (patch)
treeeffa4dd04869c688c3dd76292abe93a07abacdf6 /regress
parent5ce5828d55ac1a09b8ee46079947c58bb40bbce8 (diff)
Tests for new boolean operations.
Diffstat (limited to 'regress')
-rw-r--r--regress/usr.bin/dc/Makefile7
-rw-r--r--regress/usr.bin/dc/t14.in78
-rw-r--r--regress/usr.bin/dc/t14.out7
-rw-r--r--regress/usr.bin/dc/t15.in55
-rw-r--r--regress/usr.bin/dc/t15.out3
-rw-r--r--regress/usr.bin/dc/t16.in48
-rw-r--r--regress/usr.bin/dc/t16.out2
7 files changed, 198 insertions, 2 deletions
diff --git a/regress/usr.bin/dc/Makefile b/regress/usr.bin/dc/Makefile
index 6a951dfe297..44949d3ac25 100644
--- a/regress/usr.bin/dc/Makefile
+++ b/regress/usr.bin/dc/Makefile
@@ -1,8 +1,8 @@
-# $OpenBSD: Makefile,v 1.5 2003/11/06 19:50:04 otto Exp $
+# $OpenBSD: Makefile,v 1.6 2003/11/14 20:27:17 otto Exp $
DC=dc
-REGRESS_TARGETS=t1 t2 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13
+REGRESS_TARGETS=t1 t2 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16
# .in: input file
# .out: desired result
@@ -19,6 +19,9 @@ REGRESS_TARGETS=t1 t2 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13
# t11: test extended comparison operators
# t12: test r operator, prints two "stack empty" warnings
# t13: test #, n and a
+# t14: test N, G, ( and {
+# t15: more N, G, ( and {
+# t16: even more N, G, ( and {
all: clean ${REGRESS_TARGET}
diff --git a/regress/usr.bin/dc/t14.in b/regress/usr.bin/dc/t14.in
new file mode 100644
index 00000000000..cd4a5da828f
--- /dev/null
+++ b/regress/usr.bin/dc/t14.in
@@ -0,0 +1,78 @@
+[[ok]P]s0
+[[nok]P]s1
+ 0 0G 0!=0e1
+[[nok]P]s0
+[[ok]P]s1
+ 1 0G 0!=0e1
+[[nok]P]s0
+[[ok]P]s1
+ 0 1G 0!=0e1
+[
+]n
+[[nok]P]s0
+[[ok]P]s1
+ 0 0GN 0!=0e1
+[[ok]P]s0
+[[nok]P]s1
+ 1 0GN 0!=0e1
+[[ok]P]s0
+[[nok]P]s1
+ 0 1GN 0!=0e1
+[
+]n
+[[ok]P]s0
+[[nok]P]s1
+ 0 0G 0!=0e1
+[[nok]P]s0
+[[ok]P]s1
+ 1 0G 0!=0e1
+[[nok]P]s0
+[[ok]P]s1
+ 0 1G 0!=0e1
+[
+]n
+[[ok]P]s0
+[[nok]P]s1
+ 1 0( 0!=0e1
+[[nok]P]s0
+[[ok]P]s1
+ 0 1( 0!=0e1
+[[nok]P]s0
+[[ok]P]s1
+ 1 1( 0!=0e1
+[
+]n
+[[ok]P]s0
+[[nok]P]s1
+ 1 0{ 0!=0e1
+[[nok]P]s0
+[[ok]P]s1
+ 0 1{ 0!=0e1
+[[ok]P]s0
+[[nok]P]s1
+ 1 1{ 0!=0e1
+[
+]n
+[[nok]P]s0
+[[ok]P]s1
+ 0 1( 0!=0e1
+[[ok]P]s0
+[[nok]P]s1
+ 1 0( 0!=0e1
+[[nok]P]s0
+[[ok]P]s1
+ 1 1( 0!=0e1
+[
+]n
+[[nok]P]s0
+[[ok]P]s1
+ 0 1{ 0!=0e1
+[[ok]P]s0
+[[nok]P]s1
+ 1 0{ 0!=0e1
+[[ok]P]s0
+[[nok]P]s1
+ 1 1{ 0!=0e1
+[
+]n
+q \ No newline at end of file
diff --git a/regress/usr.bin/dc/t14.out b/regress/usr.bin/dc/t14.out
new file mode 100644
index 00000000000..d0237567c4e
--- /dev/null
+++ b/regress/usr.bin/dc/t14.out
@@ -0,0 +1,7 @@
+okokok
+okokok
+okokok
+okokok
+okokok
+okokok
+okokok
diff --git a/regress/usr.bin/dc/t15.in b/regress/usr.bin/dc/t15.in
new file mode 100644
index 00000000000..bf586a6d471
--- /dev/null
+++ b/regress/usr.bin/dc/t15.in
@@ -0,0 +1,55 @@
+[s. 2]s1
+[[ok1]P]s0
+ 1d0!=1 0!=0
+[s. 2]s1
+[[nok2]P]s0
+[[ok2]P]s2
+ 0d0!=1 0!=0e2
+[s. 0]s1
+[[nok3]P]s0
+[[ok3]P]s2
+ 3d0!=1 0!=0e2
+[s. 0]s1
+[[nok4]P]s0
+[[ok4]P]s2
+ 0d0!=1 0!=0e2
+[s. 0]s1
+[s. 0]s2
+[[nok5]P]s0
+[[ok5]P]s3
+ 0d0!=1d0!=2 0!=0e3
+[s. 1]s1
+[s. 0]s2
+[[nok6]P]s0
+[[ok6]P]s3
+ 0d0!=1d0!=2 0!=0e3
+[s. 1]s1
+[s. 1]s2
+[[ok7]P]s0
+[[nok7]P]s3
+ 1d0!=1d0!=2 0!=0e3
+[
+]n
+[[f]P0 1Q]s
+
+
+[[g]P 1 1Q0 1Q]s
+
+
+[s.lx]s1
+[[nok8]P]s0
+[[ok8]P]s2
+lxd0!=1 0!=0e2
+[s.lx]s1
+[[ok9]P]s0
+[[nok9]P]s2
+lxNd0!=1 0!=0e2
+[
+]n
+[s. 4 3(]s1
+[[ok10]P]s0
+[[nok10]P]s2
+ 2 1(d0!=1 0!=0e2
+[
+]n
+q \ No newline at end of file
diff --git a/regress/usr.bin/dc/t15.out b/regress/usr.bin/dc/t15.out
new file mode 100644
index 00000000000..ba78f644879
--- /dev/null
+++ b/regress/usr.bin/dc/t15.out
@@ -0,0 +1,3 @@
+ok1ok2ok3ok4ok5ok6ok7
+fok8fgok9
+ok10
diff --git a/regress/usr.bin/dc/t16.in b/regress/usr.bin/dc/t16.in
new file mode 100644
index 00000000000..1b1f998a7b4
--- /dev/null
+++ b/regress/usr.bin/dc/t16.in
@@ -0,0 +1,48 @@
+[s. 0]s1
+[[nok1]P]s0
+[[ok1]P]s2
+ 0d0=1 0!=0e2
+[s. 0]s1
+[[ok2]P]s0
+[[nok2]P]s2
+ 1d0=1 0!=0e2
+[s. 1]s1
+[[ok3]P]s0
+[[nok3]P]s2
+ 0d0=1 0!=0e2
+[s. 1]s1
+[[ok4]P]s0
+[[nok4]P]s2
+ 1d0=1 0!=0e2
+[
+]n
+
+[[f]P 0 1Q0 1Q]s
+
+
+[[g]P 0 1Q0 1Q]s
+
+
+[[h]P 1 1Q0 1Q]s
+
+
+
+[s.lx]s1
+[s.lx]s2
+[[ok5]P]s0
+[[nok5]P]s3
+lxd0=1d0=2 0!=0e3
+[s.lx]s1
+[s.lxN]s2
+[[nok6]P]s0
+[[ok6]P]s3
+lxd0=1d0=2 0!=0e3
+[s.lxN]s1
+[s.lx]s2
+[[nok7]P]s0
+[[ok7]P]s3
+lxd0=1d0=2 0!=0e3
+
+[
+]n
+q \ No newline at end of file
diff --git a/regress/usr.bin/dc/t16.out b/regress/usr.bin/dc/t16.out
new file mode 100644
index 00000000000..9da14e7e26b
--- /dev/null
+++ b/regress/usr.bin/dc/t16.out
@@ -0,0 +1,2 @@
+ok1ok2ok3ok4
+fghok5fghok6fhgok7