summaryrefslogtreecommitdiffhomepage
path: root/tests/posix/printf-ext.exp
Commit message (Collapse)AuthorAgeFilesLines
* tests: cover the review fixes that landed without oneSean Kurtz34 hours1-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 2026-11-28 review merge (#46) and the in-process `( cd dir )` merge (#31) left four changes with no test of their own. Three of the eighteen commits cannot have one, see below. - tests/posix/glob-edge.sh: `deep/*` where `deep` holds a file, a subdirectory, a symlink and a dangling symlink. This is the path the glob change takes when the last component has no literal tail left: it adds what readdir() named without an lstat(), so a directory and a broken link must still appear. Replacing `sb_cstr(&g->path)` with the unterminated buffer in that call makes this test fail. - tests/posix/charset.sh: a reversed range `[z-a]` matches nothing, which is what dash and bash do; the ASCII fast path compares bytes where the EBCDIC path looks up a table, so the two must agree on the edge. - tests/posix/printf-ext.sh: a 5000-character `%s`. The bare `%s` fast path writes the argument straight to the output instead of through the format buffer, so length is now the output's business. - tests/zash/heredoc-tmpdir.sh: a TMPDIR longer than PATH_MAX still produces the here-document, through the pipe fallback. - .exp files regenerated with dash (posix) and ./zash (zash), then reviewed: only the added lines differ. The three commits with no test: - 270ac66 `signal()` to `sigaction()` for SIG_DFL: the disposition set is the same, so no test can tell the two apart. - 06e1dd5 the arena size guard: reaching it needs a SIZE_MAX/2 allocation. - de0d26a the TMPDIR length check itself: a truncated temp name has no `XXXXXX` left, so mkstemp() already failed and the pipe fallback already ran. heredoc-tmpdir.sh pins that fallback, not the check. Verified on Linux (7.3.4-300.fc45.x86_64, 2026-11-28): make check 128 passed, 1 skipped, the known linux/i-dscomplete failure; make asan the same with no sanitizer report; the new posix tests pass against dash too.
* fix(printf): a negative '*' precision is no precisionSean Kurtz2 days1-0/+0
| | | | | | | | | | | | | | | | | `printf '%.*d' -5 1` built the conversion "%.-5jd" and printed it literally: a width and precision taken with '*' were written with "%d" of an (int) cast, so a negative precision produced ".-5" in the spec. copy_number() now writes the value with "%jd" - no narrowing, which the review asked for - and, for a precision, drops the '.' again when the value is negative: C99 says a negative precision is as if it were omitted. A negative width stays, where snprintf() reads the '-' as a flag. tests/posix/printf-ext.sh covers all four shapes; the expected output is what dash and bash print. Verified: make check, and the same test under ASan+UBSan on Linux.
* Edge-case, integration and z/OS tests, including z/OS stand-insSean Kurtz2026-11-151-0/+0
New groups: tests/scripts (integration, expectations from dash) and z/OS data set, tso, EBCDIC and tagging tests with Linux stand-ins.