aboutsummaryrefslogtreecommitdiff
path: root/tests/function/builtin/testscript
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-03-17 07:33:41 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-03-17 07:47:17 +0200
commitbab021a6203127f38fb89c61cc41deb3e0abbe62 (patch)
tree868ddce415b985636baed5dd566ec4bd11f67c99 /tests/function/builtin/testscript
parent962f83b1e551cc683f1052d32cb79b969e65af5f (diff)
Add $defined(<variable>) function
Diffstat (limited to 'tests/function/builtin/testscript')
-rw-r--r--tests/function/builtin/testscript19
1 files changed, 17 insertions, 2 deletions
diff --git a/tests/function/builtin/testscript b/tests/function/builtin/testscript
index acd544d..3d31ca2 100644
--- a/tests/function/builtin/testscript
+++ b/tests/function/builtin/testscript
@@ -3,6 +3,23 @@
.include ../../common.testscript
+: defined
+:
+{
+ : true
+ :
+ $* <<EOI >'true'
+ foo = [null]
+ print $defined(foo)
+ EOI
+
+ : false
+ :
+ $* <<EOI >'false'
+ print $defined(foo)
+ EOI
+}
+
: type
:
{
@@ -93,9 +110,7 @@
<stdin>:1:8: error: unmatched call to getenv()
/((
info: candidate: getenv(<untyped>), qualified name builtin.getenv
- info: candidate: getenv(string), qualified name builtin.getenv
/)|(
- info: candidate: getenv(string), qualified name builtin.getenv
info: candidate: getenv(<untyped>), qualified name builtin.getenv
/))
EOE