diff options
| author | Jonas Maier <jonas@x77.dev> | 2026-06-02 22:00:57 +0200 |
|---|---|---|
| committer | Jonas Maier <jonas@x77.dev> | 2026-06-02 22:00:57 +0200 |
| commit | 10defcf9f7132bdcc88c1fe32d9550a0d5952042 (patch) | |
| tree | a12085cedd489bec1e73abb2c368474471894d42 /test-cases/case3_negative_lookahead | |
| parent | dbca276ac60af603209f62dcc2e0e1fcfbebae11 (diff) | |
| download | pish-10defcf9f7132bdcc88c1fe32d9550a0d5952042.tar.gz | |
split lookahead tests into positive and negative
Diffstat (limited to 'test-cases/case3_negative_lookahead')
| -rw-r--r-- | test-cases/case3_negative_lookahead/script.sh | 43 | ||||
| -rw-r--r-- | test-cases/case3_negative_lookahead/stdout.txt | 0 |
2 files changed, 43 insertions, 0 deletions
diff --git a/test-cases/case3_negative_lookahead/script.sh b/test-cases/case3_negative_lookahead/script.sh new file mode 100644 index 0000000..3246f74 --- /dev/null +++ b/test-cases/case3_negative_lookahead/script.sh @@ -0,0 +1,43 @@ +fun match { + set res = $($1 $2) + if [ $res != $3 ] { + echo "match $1 $2: expected $3, got $res" + } +} + +fun x1 { + case $1 { + a(?!x)x { echo yes } + .* { echo no } + } +} +match x1 a no +match x1 aa no +match x1 ax no +match x1 axx no +match x1 aax no + +fun x3 { + case $1 { + x(?!(a|b)).* { echo yes } + .* { echo no } + } +} +match x3 x yes +match x3 xa no +match x3 xb no +match x3 xax no +match x3 xbx no +match x3 xxa yes +match x3 xxb yes +match x3 xfoobar yes + +fun x4 { + case $1 { + x(?!a).* { echo yes } + .* { echo no } + } +} +match x4 x yes +match x4 xa no +match x4 xy no diff --git a/test-cases/case3_negative_lookahead/stdout.txt b/test-cases/case3_negative_lookahead/stdout.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test-cases/case3_negative_lookahead/stdout.txt |
