aboutsummaryrefslogtreecommitdiff
path: root/old-tests/eval
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-12-01 12:07:18 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-12-01 12:07:18 +0200
commit0ed86c76239d4f2904ea4ae1a77902a9e0db2a6d (patch)
tree5e8e1d43a0140f5739b21be7cbe120ebb9360d4f /old-tests/eval
parent12fc75188cc1f0a8c4c443c04e7a022131198c36 (diff)
Move old tests to old-tests/
Diffstat (limited to 'old-tests/eval')
-rw-r--r--old-tests/eval/buildfile72
-rw-r--r--old-tests/eval/test.out36
-rwxr-xr-xold-tests/eval/test.sh3
3 files changed, 111 insertions, 0 deletions
diff --git a/old-tests/eval/buildfile b/old-tests/eval/buildfile
new file mode 100644
index 0000000..f26a9a0
--- /dev/null
+++ b/old-tests/eval/buildfile
@@ -0,0 +1,72 @@
+(./):
+()
+
+# Invalid.
+#
+#(foo
+#(foo #comment
+
+print ()
+print ((foo)(bar))
+print ((foo) (bar))
+
+print (foo\
+bar)
+
+# !=, == vs !, = recognition
+#
+print (=)
+print (!)
+print (= foo)
+print (foo!)
+
+# !=, == evaluation
+#
+
+# print ( == bar)
+# print (foo == )
+
+print (foo == bar)
+print (foo == foo)
+print (foo != bar)
+print (foo != foo)
+
+print (foo == (foo))
+print ((foo bar) == foo bar)
+print (foo != foo bar)
+print ("" == '')
+
+print ((foo != bar) baz)
+print "foo equals bar is (foo == bar)"
+
+foo = foo
+print ($foo == foo)
+print (bar != $foo)
+
+print ([null])
+print (([null]))
+print ([uint64] 01)
+
+n = [null]
+print ($n == [null])
+print ($N == [null])
+print ([null] == [null])
+
+print ($n == $N == true)
+
+n =
+print ($n == )
+n = {}
+print ($n == "")
+
+#print ([uint64] 01 == [string] 01)
+
+# <, <=, >, >= evaluation
+#
+print (a < b)
+print (a b > a a)
+print (123 <= 123)
+print ([uint64] 02 > [uint64] 01)
+print (a > [null])
+print ([uint64] 02 > [null])
+print ($build.version > 30000)
diff --git a/old-tests/eval/test.out b/old-tests/eval/test.out
new file mode 100644
index 0000000..555853f
--- /dev/null
+++ b/old-tests/eval/test.out
@@ -0,0 +1,36 @@
+
+foobar
+foo bar
+foobar
+=
+!
+= foo
+foo!
+false
+true
+true
+false
+true
+true
+true
+true
+true baz
+foo equals bar is false
+true
+true
+[null]
+[null]
+1
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
+true
diff --git a/old-tests/eval/test.sh b/old-tests/eval/test.sh
new file mode 100755
index 0000000..c745b76
--- /dev/null
+++ b/old-tests/eval/test.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+b -q | diff --strip-trailing-cr -u test.out -