| 1 |
# These tests check that regex engines perform as expected when the search is |
| 2 |
# instructed to only search a substring of a haystack instead of the entire |
| 3 |
# haystack. This tends to exercise interesting edge cases that are otherwise |
| 4 |
# difficult to provoke. (But not necessarily impossible. Regex search iterators |
| 5 |
# for example, make use of the "search just a substring" APIs by changing the |
| 6 |
# starting position of a search to the end position of the previous match.) |
| 7 |
|
| 8 |
[[test]] |
| 9 |
name = "unicode-word-start" |
| 10 |
regex = '\b[0-9]+\b' |
| 11 |
haystack = "β123" |
| 12 |
bounds = { start = 2, end = 5 } |
| 13 |
matches = [] |
| 14 |
|
| 15 |
[[test]] |
| 16 |
name = "unicode-word-end" |
| 17 |
regex = '\b[0-9]+\b' |
| 18 |
haystack = "123β" |
| 19 |
bounds = { start = 0, end = 3 } |
| 20 |
matches = [] |
| 21 |
|
| 22 |
[[test]] |
| 23 |
name = "ascii-word-start" |
| 24 |
regex = '\b[0-9]+\b' |
| 25 |
haystack = "β123" |
| 26 |
bounds = { start = 2, end = 5 } |
| 27 |
matches = [[2, 5]] |
| 28 |
unicode = false |
| 29 |
|
| 30 |
[[test]] |
| 31 |
name = "ascii-word-end" |
| 32 |
regex = '\b[0-9]+\b' |
| 33 |
haystack = "123β" |
| 34 |
bounds = { start = 0, end = 3 } |
| 35 |
matches = [[0, 3]] |
| 36 |
unicode = false |