diff options
| author | Sean Kurtz <seankurtz75@gmail.com> | 2026-11-28 16:37:21 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-28 16:37:21 -0600 |
| commit | 7f87e66066accfe78c7b0d4b291c9be52e1dc818 (patch) | |
| tree | 70f802e577c24b23eb3a96098b4500a913bab399 | |
| parent | 3f24ca27250ade07c34a98fb792e6ca64e54c21b (diff) | |
| parent | 648125a5ef1a98519c5d2cd66c4f015bcb8b5b1f (diff) | |
| download | zash-7f87e66066accfe78c7b0d4b291c9be52e1dc818.tar.gz | |
Merge pull request #47 from skurtz97/tests/regression-gaps
tests: cover the review fixes that landed without one
| -rw-r--r-- | tests/posix/charset.exp | 1 | ||||
| -rw-r--r-- | tests/posix/charset.sh | 1 | ||||
| -rw-r--r-- | tests/posix/glob-edge.exp | 1 | ||||
| -rw-r--r-- | tests/posix/glob-edge.sh | 2 | ||||
| -rw-r--r-- | tests/posix/printf-ext.exp | bin | 338 -> 343 bytes | |||
| -rw-r--r-- | tests/posix/printf-ext.sh | 1 | ||||
| -rw-r--r-- | tests/zash/heredoc-tmpdir.exp | 3 | ||||
| -rw-r--r-- | tests/zash/heredoc-tmpdir.sh | 8 |
8 files changed, 17 insertions, 0 deletions
diff --git a/tests/posix/charset.exp b/tests/posix/charset.exp index b930bec..209df77 100644 --- a/tests/posix/charset.exp +++ b/tests/posix/charset.exp @@ -10,6 +10,7 @@ z in s-z j in i-j k not in a-j case sensitive +reversed range matches nothing punct class alpha class digit class diff --git a/tests/posix/charset.sh b/tests/posix/charset.sh index e5d875d..53e519a 100644 --- a/tests/posix/charset.sh +++ b/tests/posix/charset.sh @@ -27,6 +27,7 @@ for c in a i j r s z; do case $c in [a-i]) echo "$c in a-i" ;; [j-r]) echo "$c i case j in [i-j]) echo "j in i-j" ;; esac case k in [!a-j]) echo "k not in a-j" ;; esac case B in [a-z]) echo "B wrongly lower" ;; *) echo "case sensitive" ;; esac +case m in [z-a]) echo "reversed range matched: $m" ;; *) echo "reversed range matches nothing" ;; esac case _ in [[:alpha:]]) echo no ;; [[:punct:]]) echo "punct class" ;; esac case x in [[:alpha:]]) echo "alpha class" ;; esac case 5 in [[:digit:]]) echo "digit class" ;; esac diff --git a/tests/posix/glob-edge.exp b/tests/posix/glob-edge.exp index 5c5bb34..28ccf97 100644 --- a/tests/posix/glob-edge.exp +++ b/tests/posix/glob-edge.exp @@ -1,3 +1,4 @@ +deep/a deep/broken deep/link deep/sub a1 a2 a1 b1 a1 b1 diff --git a/tests/posix/glob-edge.sh b/tests/posix/glob-edge.sh index 006e948..98caf8f 100644 --- a/tests/posix/glob-edge.sh +++ b/tests/posix/glob-edge.sh @@ -1,5 +1,7 @@ # Pathname expansion. mkdir sub; touch a1 a2 b1 .hidden 'sp ace' sub/x sub/y '[x]' 'q?' +mkdir deep; mkdir deep/sub; ln -s a deep/link; ln -s nowhere deep/broken; touch deep/a +echo deep/* | tr ' ' '\n' | sort | tr '\n' ' '; echo echo a* echo *1 echo ?1 | tr ' ' '\n' | sort | tr '\n' ' '; echo diff --git a/tests/posix/printf-ext.exp b/tests/posix/printf-ext.exp Binary files differindex 8ddaab7..83299d0 100644 --- a/tests/posix/printf-ext.exp +++ b/tests/posix/printf-ext.exp diff --git a/tests/posix/printf-ext.sh b/tests/posix/printf-ext.sh index 066aa2e..cace68f 100644 --- a/tests/posix/printf-ext.sh +++ b/tests/posix/printf-ext.sh @@ -19,6 +19,7 @@ printf '%d\n' abc 2>/dev/null; echo "nan=$?" printf '%f\n' xyz 2>/dev/null; echo "nanf=$?" printf '%d\n' 0x1f 010 -0 printf '%.3s|%10.4s|\n' abcdef abcdef +long=$(awk 'BEGIN { for (i = 0; i < 5000; i++) printf "x" }'); printf '%s' "$long" | wc -c printf '%s\n' -n printf -- '--\n' printf '\101\102\n' diff --git a/tests/zash/heredoc-tmpdir.exp b/tests/zash/heredoc-tmpdir.exp new file mode 100644 index 0000000..1b97303 --- /dev/null +++ b/tests/zash/heredoc-tmpdir.exp @@ -0,0 +1,3 @@ +hi +status=0 +[status 0] diff --git a/tests/zash/heredoc-tmpdir.sh b/tests/zash/heredoc-tmpdir.sh new file mode 100644 index 0000000..437c5e7 --- /dev/null +++ b/tests/zash/heredoc-tmpdir.sh @@ -0,0 +1,8 @@ +# A TMPDIR too long for the here-document temp path falls back to a pipe +# instead of writing a truncated name. +long=$(awk 'BEGIN { for (i = 0; i < 5000; i++) printf "x" }') +TMPDIR=/$long +cat <<TXT +hi +TXT +echo "status=$?" |
