Skip to content

Commit

Permalink
reduce test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
kivikakk committed Jul 1, 2024
1 parent dd15317 commit 0d18a24
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions build.zig.zon
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
.version = "0.1.0",
.dependencies = .{
.pcre = .{
.url = "https://github.com/kivikakk/pcre-8.45/archive/812524706afd3a333c1fb31100e046f167740ac3.tar.gz",
.hash = "1220ac1f2dc0def06527baacecdacf3daae723bf0b439356ee5db6868ca255412b59",
.url = "https://github.com/kivikakk/pcre-8.45/archive/6b7cf03e4896c240c4baba2d6497e4be3ee1e22c.tar.gz",
.hash = "12203da4b45a5553c5a5f444b58378562cb4bea00e896426d82bd3164bfce811c5ab",
},
},
.minimum_zig_version = "0.12.0",
Expand Down
9 changes: 5 additions & 4 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -258,10 +258,11 @@ test "missing capture group at end of capture list" {
}

test "what" {
const regex = try Regex.compile("(?:(\\\\.|[^|\r\n])*)", .{ .Utf8 = true });
const regex = try Regex.compile("(?:ab|.)*", .{});
defer regex.deinit();

const line =
" the void type can only have a single value (which is also voida) and " ++
" indicates the absence of a value. Functions that do not ret |\n";
try testing.expect((try regex.matches(line, .{ .Anchored = true })) != null);
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ++
"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
try testing.expect((try regex.matches(line, .{})) != null);
}

0 comments on commit 0d18a24

Please sign in to comment.