Skip to content

Commit

Permalink
test: simplified 'general newilne' \R case
Browse files Browse the repository at this point in the history
  • Loading branch information
bzz committed May 21, 2023
1 parent 0e3d019 commit 7abbed9
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion regex_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,18 @@ var findTests = []FindTest{
30, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 36),
},

{`^\s*BEGIN\R\s*.*\R`, ` BEGIN
// https://github.com/kkos/oniguruma/blob/2a25d8c2c4699c57f4d456ccd13149c0c714723d/test/test_back.c#LL629C1-L631C25
{"\\R", "\r\n", build(1, 0, 2)},
{"\\R", "\r", build(1, 0, 1)},
{"\\R", "\n", build(1, 0, 1)},

{`b\R.*\R`, "ab\nc\n", build(1, 1, 5)},
// equivalent, from Linguist dataset
{`^\s*BEGIN\R\s*.*\R`, "\tBEGIN\n\tMultiUse = -1 'True\n", build(1, 0, 29)},
}

func TestOne(t *testing.T) {
s := ` BEGIN
MultiUse = -1 'True
`, build(1, 0, 29)},
}
Expand Down

0 comments on commit 7abbed9

Please sign in to comment.