aboutsummaryrefslogtreecommitdiffstats
path: root/test-cases/case2_lookahead
diff options
context:
space:
mode:
authorJonas Maier <jonas@x77.dev>2026-06-02 22:00:57 +0200
committerJonas Maier <jonas@x77.dev>2026-06-02 22:00:57 +0200
commit10defcf9f7132bdcc88c1fe32d9550a0d5952042 (patch)
treea12085cedd489bec1e73abb2c368474471894d42 /test-cases/case2_lookahead
parentdbca276ac60af603209f62dcc2e0e1fcfbebae11 (diff)
downloadpish-10defcf9f7132bdcc88c1fe32d9550a0d5952042.tar.gz
split lookahead tests into positive and negative
Diffstat (limited to 'test-cases/case2_lookahead')
-rw-r--r--test-cases/case2_lookahead/script.sh65
-rw-r--r--test-cases/case2_lookahead/stdout.txt0
2 files changed, 0 insertions, 65 deletions
diff --git a/test-cases/case2_lookahead/script.sh b/test-cases/case2_lookahead/script.sh
deleted file mode 100644
index 891441b..0000000
--- a/test-cases/case2_lookahead/script.sh
+++ /dev/null
@@ -1,65 +0,0 @@
-case foo {
- f(?=o)oo {}
- .* { echo fail 1 }
-}
-
-case foo {
- fo(?=x)o { echo fail 2 }
- .* { }
-}
-
-fun match {
- set res = $($1 $2)
- if [ $res != $3 ] {
- echo "match $1 $2: expected $3, got $res"
- }
-}
-
-fun x0 {
- case $1 {
- a(?=b). { echo yes }
- .* { echo no }
- }
-}
-match x0 aa no
-match x0 aaa no
-match x0 ab yes
-
-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 x2 {
- case $1 {
- x(?=foo)(?=...bar).* { echo yes }
- .* { echo no }
- }
-}
-match x2 xfoobar yes
-match x2 xfoobar_some_more_stuff yes
-match x2 x___bar no
-match x2 xfoo___ no
-match x2 xfoo 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
diff --git a/test-cases/case2_lookahead/stdout.txt b/test-cases/case2_lookahead/stdout.txt
deleted file mode 100644
index e69de29..0000000
--- a/test-cases/case2_lookahead/stdout.txt
+++ /dev/null