aboutsummaryrefslogtreecommitdiff
path: root/unit-tests/function
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-12-05 15:09:04 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-12-05 15:09:04 +0200
commit54870fb76b5f59cc2e6d69a8c7a8ef17853a0029 (patch)
tree770b01aa56348ec75f17fb834a2a7123ba9c3f73 /unit-tests/function
parentef7cb7ea3e6fcb21a4fcf38602b3f43f03232ace (diff)
Add comma, ternary, logical operators support in eval context
Diffstat (limited to 'unit-tests/function')
-rw-r--r--unit-tests/function/call.test3
-rw-r--r--unit-tests/function/driver.cxx1
-rw-r--r--unit-tests/function/syntax.test2
3 files changed, 4 insertions, 2 deletions
diff --git a/unit-tests/function/call.test b/unit-tests/function/call.test
index d16b91c..9129785 100644
--- a/unit-tests/function/call.test
+++ b/unit-tests/function/call.test
@@ -25,8 +25,7 @@ $* <'print $dummy.abs([abs_dir_path] .)' >'true'
: variadic
:
-# @@ TMP: add some args
-$* <'print $variadic([bool] true)' >'1'
+$* <'print $variadic([bool] true, foo, bar)' >'3'
: fail
:
diff --git a/unit-tests/function/driver.cxx b/unit-tests/function/driver.cxx
index 3dea374..235af0c 100644
--- a/unit-tests/function/driver.cxx
+++ b/unit-tests/function/driver.cxx
@@ -38,6 +38,7 @@ namespace build2
f["dummy0"] = []() {return "abc";};
f["dummy1"] = [](string s) {return s;};
+ f["dummy2"] = [](uint64_t x, uint64_t y) {return x + y;};
f["ambig"] = [](names a, optional<string>) {return a;};
f["ambig"] = [](names a, optional<uint64_t>) {return a;};
diff --git a/unit-tests/function/syntax.test b/unit-tests/function/syntax.test
index d644fd1..11ff3c1 100644
--- a/unit-tests/function/syntax.test
+++ b/unit-tests/function/syntax.test
@@ -12,6 +12,8 @@ $* <'$dump(d/t{x y z})' >'d/t{x} d/t{y} d/t{z}' : one-names
$* <'print a$dummy1 ([string] b)c' >'abc' : concat
+$* <'print $dummy2([uint64] 123, [uint64] 321)' >'444' : multi-arg
+
: quoting
: Verify we can inhibit function call with quoting
: