From e42da2a469404e1d421ccee7ccbccb36f363a98b Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Mon, 30 Sep 2019 13:57:10 +0200 Subject: Handle attributes in switch value and pattern expressions --- tests/switch/testscript | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) (limited to 'tests') 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 : $* <>EOO for i: 123 abc @@ -86,7 +86,7 @@ n a EOO -: basics-matcher-arg +: matcher-arg : $* <>EOO for i: abc ABC aBC @@ -103,7 +103,7 @@ a a EOO -: basics-matcher-multiple +: matcher-multiple : $* <>EOO for i: 123 abc @@ -126,7 +126,7 @@ aa EOO #\ -: basics-extractor +: extractor : $* <>EOO for i: 123 abc @@ -145,6 +145,36 @@ d EOO #\ +: attributes +: +$* <>EOO +switch [uint64] 1, 01 +{ + case 01, [uint64] 1 + print 1 +} +EOI +1 +EOO + +: null +: +$* <>EOO +for i: 0 1 +{ + switch ($i == 0 ? [null] : $i) + { + case [null] + print n + case [uint64] 1 + print 1 + } +} +EOI +n +1 +EOO + : empty : $* <