aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-04-18 10:17:37 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-04-18 10:17:37 +0200
commitae20570f2ad55b2fa8e71cf450457cb9c4b21b1b (patch)
tree4db6740878ffb28fb00c5fc323a1891300db749e /tests
parente2501db05c9e9f139d22f3748584992679954721 (diff)
Add support for using value attributes in eval context
For example: if ($x == [null]) Or: if ([uint64] 01 == [uint64] 1)
Diffstat (limited to 'tests')
-rw-r--r--tests/eval/buildfile16
-rw-r--r--tests/eval/test.out9
-rw-r--r--tests/variable/override/buildfile2
-rw-r--r--tests/variable/qualified/buildfile4
4 files changed, 28 insertions, 3 deletions
diff --git a/tests/eval/buildfile b/tests/eval/buildfile
index 06fb5fb..b1e5350 100644
--- a/tests/eval/buildfile
+++ b/tests/eval/buildfile
@@ -42,3 +42,19 @@ 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 == "")
diff --git a/tests/eval/test.out b/tests/eval/test.out
index 599f928..bad003e 100644
--- a/tests/eval/test.out
+++ b/tests/eval/test.out
@@ -18,3 +18,12 @@ true baz
foo equals bar is false
true
true
+[null]
+[null]
+1
+true
+true
+true
+true
+true
+true
diff --git a/tests/variable/override/buildfile b/tests/variable/override/buildfile
index 18c9831..c090e81 100644
--- a/tests/variable/override/buildfile
+++ b/tests/variable/override/buildfile
@@ -1,4 +1,4 @@
-if ("$t" != "")
+if ($t != [null])
{
[$t] v = [null]
}
diff --git a/tests/variable/qualified/buildfile b/tests/variable/qualified/buildfile
index 90e75c7..870b808 100644
--- a/tests/variable/qualified/buildfile
+++ b/tests/variable/qualified/buildfile
@@ -1,5 +1,5 @@
-#v = (:bar) # error: expected name instead of ':'
-#v = (foo:) # error: scope/target expected after ':'
+#v = (foo:) # error: variable name expected before ':'
+#v = (:bar) # error: scope/target expected after ':'
print (foo:bar)
print (foo :bar)