Commit Graph
44 Commits
Author SHA1 Message Date
Diomidis Spinellis e9792a8ef9 Improve GNU compatibility through byte processing (#487)
The original Rust implementation assummed a UTF-8 environment, as is
common in modern systems.  This commit improves GNU sed compatibility
by changing most processing to run on bytes rather than Rust's Unicode
characters and strings. This change also improves the handling of binary
files. The commit adds a simple POSIX-compatible locale configuration
to support UTF-8 processing when specified. While at it, also fix
script-specified file handling to take place through OsString and
add a few missing unit tests.

The change fixes two failing GNU test suite cases.
2026-07-26 19:44:54 +02:00
Diomidis Spinellis 01c8412327 Optimize multiline matching (#483)
The multiline matching resulted in a large performance regression due to
the indiscriminate use of the dotall (?s) flag.  Change the regex
selection process to use only the flag when probably needed.
2026-07-05 15:13:53 +02:00
Diomidis Spinellis a9e5fe778c Add sandbox checks (#477)
Following the introduction of the first sandbox check in b14272c1
complete the checks for the remaining commands.
2026-07-03 16:55:50 +02:00
Diomidis Spinellis cd3b10db48 Document uutils Playground 2026-07-01 10:48:54 +03:00
Diomidis Spinellis 48c2f56358 Document r command extension 2026-07-01 10:42:22 +03:00
Diomidis Spinellis 3b846498f4 Add current POSIX specification link
Link to POSIX document to help contributors.
2026-06-01 21:41:25 +03:00
mukunda katta f6e69e734b fix: preserve latest binary executable mode 2026-05-24 17:57:32 +02:00
LoukasPap 5e9b821d80 Set max addresses to 2 for a, i and = and make n_addr conditional, based on POSIX flag
- Update `get_cmd_spec()` and `get_verified_cmd_spec()` to accept a boolean POSIX param
- Add unit and high level tests
- Update README.md
2026-03-19 22:21:56 +01:00
Kevin BurkeandClaude Opus 4.6 16f11456b3 fix: rewrite GNU testsuite harness to run upstream test scripts directly
The previous harness tried to extract sed commands from GNU test scripts
via regex pattern matching, which produced false negatives (comparing
against empty expected output) and false positives. This led to inflated
test counts and unreliable pass/fail signals.

The new approach:
- Provides a lightweight shim for the gnulib test framework (init.sh)
  with implementations of compare_, returns_, skip_, framework_failure_,
  and all require_* functions
- Executes each .sh test script from the GNU testsuite directly,
  injecting our Rust sed binary via PATH
- Uses a clean srcdir with symlinks to real test data files
- Adds per-test timeout (10s) to catch infinite loops, with SIGTERM
  isolation so timeout signals don't kill the parent script
- Properly propagates exit codes (0=pass, 77=skip, 99=framework failure)

Results are now consistent with CI tracking (~12% pass rate) with
clear PASS/FAIL/SKIP/timeout categorization.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 22:04:56 +01:00
Sylvestre Ledru 91affcf90b Update CodeCov badge to point to main branch 2026-02-15 12:11:40 +01:00
oech3 1617d32d5d README.md: Link tag/latest-commit 2026-01-28 11:12:45 +01:00
Diomidis Spinellis 8039955354 Add support for GNU ~step address ranges 2026-01-28 08:40:54 +01:00
Diomidis Spinellis a0d82d678d Support ranges starting from line 0
This is a GNU extension that starts the range as latched.
While at it, also fix the handling of ranges straddling independent
files.
2026-01-28 08:40:54 +01:00
Sylvestre Ledru 5d452d4174 link to the sed tracking project 2026-01-11 21:12:00 +01:00
Sylvestre Ledru 3fa2227ebf Run against the GNU implementation (#223)
* Add a script to run the sed testsuite

* run the gnu testsuite in the ci

* remove useless comment
2025-12-21 13:05:37 +01:00
Sylvestre Ledru 8b6ff1d86a generate the sed binary directly 2025-12-14 18:07:22 +01:00
Sylvestre Ledru 380a0a74d6 README: explain how to call it sed 2025-11-23 22:43:46 +01:00
Sylvestre Ledru c47f7c94fb README: improve the syntax 2025-11-23 22:39:44 +01:00
Diomidis Spinellis 56ad3e9f4f Update progress status 2025-08-08 15:57:44 +03:00
Diomidis Spinellis 80a7d0288c Support GNU syntax for the a, c, i commands
The original POSIX behavior is now available under --posix.

Issue: #86
2025-07-27 13:21:59 +03:00
Diomidis Spinellis 602a23dae6 Adjust README to reflect the merging of #77 2025-06-04 11:30:54 +03:00
Sylvestre Ledru 0b390c06d1 Merge branch 'main' into aci-commands 2025-06-04 09:20:10 +02:00
Sylvestre Ledru a60f078945 fix a typo (to retrigger the CI) 2025-06-01 16:41:59 +02:00
Diomidis Spinellis a2e19695ff Add in-place editing support 2025-05-30 19:52:52 +03:00
Diomidis Spinellis 18cf3fc52c Add l and Q commands, extended with GNU number 2025-05-30 10:39:34 +03:00