aboutsummaryrefslogtreecommitdiff
path: root/tests/switch/testscript
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2019-09-30 13:57:10 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2019-09-30 15:30:55 +0200
commite42da2a469404e1d421ccee7ccbccb36f363a98b (patch)
tree62e5f89e99bd6b70dffdfc2f25f5d99d5aae5cd3 /tests/switch/testscript
parent4a295f6ff98e7ff7ec9a33f38748a6537780a1bf (diff)
Handle attributes in switch value and pattern expressions
Diffstat (limited to 'tests/switch/testscript')
-rw-r--r--tests/switch/testscript38
1 files changed, 34 insertions, 4 deletions
diff --git a/tests/switch/testscript b/tests/switch/testscript
index e0ffe8e..221ad47 100644
--- a/tests/switch/testscript
+++ b/tests/switch/testscript
@@ -68,7 +68,7 @@ EOI
d
EOO
-: basics-matcher
+: matcher
:
$* <<EOI >>EOO
for i: 123 abc
@@ -86,7 +86,7 @@ n
a
EOO
-: basics-matcher-arg
+: matcher-arg
:
$* <<EOI >>EOO
for i: abc ABC aBC
@@ -103,7 +103,7 @@ a
a
EOO
-: basics-matcher-multiple
+: matcher-multiple
:
$* <<EOI >>EOO
for i: 123 abc
@@ -126,7 +126,7 @@ aa
EOO
#\
-: basics-extractor
+: extractor
:
$* <<EOI >>EOO
for i: 123 abc
@@ -145,6 +145,36 @@ d
EOO
#\
+: attributes
+:
+$* <<EOI >>EOO
+switch [uint64] 1, 01
+{
+ case 01, [uint64] 1
+ print 1
+}
+EOI
+1
+EOO
+
+: null
+:
+$* <<EOI >>EOO
+for i: 0 1
+{
+ switch ($i == 0 ? [null] : $i)
+ {
+ case [null]
+ print n
+ case [uint64] 1
+ print 1
+ }
+}
+EOI
+n
+1
+EOO
+
: empty
:
$* <<EOI