aboutsummaryrefslogtreecommitdiff
path: root/tests/variable
diff options
context:
space:
mode:
Diffstat (limited to 'tests/variable')
-rw-r--r--tests/variable/type/buildfile21
-rw-r--r--tests/variable/type/test.out2
-rwxr-xr-xtests/variable/type/test.sh3
3 files changed, 26 insertions, 0 deletions
diff --git a/tests/variable/type/buildfile b/tests/variable/type/buildfile
new file mode 100644
index 0000000..372b0ad
--- /dev/null
+++ b/tests/variable/type/buildfile
@@ -0,0 +1,21 @@
+# Variable typing.
+#
+[string] str1 = bar
+str1 =+ foo
+str1 += baz
+print $str1
+
+str2 = bar
+[string] str2 =+ foo
+str2 += baz
+print $str2
+
+#[string] str3 = foo
+#[bool] str3 = false # error: changing str3 type from string to bool
+
+#[bool string] str3 = foo # error: multiple variable types: bool, string
+
+#[junk] jnk = foo # error: unknown variable attribute junk
+
+
+./:
diff --git a/tests/variable/type/test.out b/tests/variable/type/test.out
new file mode 100644
index 0000000..f5dfb84
--- /dev/null
+++ b/tests/variable/type/test.out
@@ -0,0 +1,2 @@
+foobarbaz
+foobarbaz
diff --git a/tests/variable/type/test.sh b/tests/variable/type/test.sh
new file mode 100755
index 0000000..afcb3bd
--- /dev/null
+++ b/tests/variable/type/test.sh
@@ -0,0 +1,3 @@
+#!/bin/sh
+
+b -q | diff -u test.out -