From 2d9f40667197ac775d5215ffd164c800f83cab4c Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 29 Sep 2026 12:35:40 -0300 Subject: A pattern with a newline and an anchor mvzr would misread is refused EINVAL, as the doc says Its words named no malformed input, so 9ns read the refusal as EIO, and Edit's failed EIO directly. It now says bad regular expression: ..., and Edit's failure with those words is EINVAL too. Co-Authored-By: Claude Opus 5.5 --- src/sam_edit.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/sam_edit.zig') diff --git a/src/sam_edit.zig b/src/sam_edit.zig index cd2998ef..a88728aa 100644 --- a/src/sam_edit.zig +++ b/src/sam_edit.zig @@ -735,7 +735,7 @@ test "an Edit that fails halfway changes nothing, and says why in acme's words" .{ "w /tmp/x", "w is not supported in pardes" }, .{ ",s/(a)/\\1/", "no \\1: mvzr keeps no submatches" }, .{ "1 m 1,2", "move overlaps itself" }, - .{ ",x/(^|\\n)foo/d", "in a pattern with \\n, ^ can only come first and $ only just before a \\n" }, + .{ ",x/(^|\\n)foo/d", "bad regular expression: in a pattern with \\n, ^ can only come first and $ only just before a \\n" }, }) |c| { var why: Why = .{}; try std.testing.expectError(error.Edit, run(arena_state.allocator(), "foo a\nfoo\n", .{}, "t", c[0], &why)); -- cgit v1.3