| 1 | [[test]] |
| 2 | name = "ascii-literal" |
| 3 | regex = "a" |
| 4 | haystack = "a" |
| 5 | matches = [[0, 1]] |
| 6 | |
| 7 | [[test]] |
| 8 | name = "ascii-literal-not" |
| 9 | regex = "a" |
| 10 | haystack = "z" |
| 11 | matches = [] |
| 12 | |
| 13 | [[test]] |
| 14 | name = "ascii-literal-anchored" |
| 15 | regex = "a" |
| 16 | haystack = "a" |
| 17 | matches = [[0, 1]] |
| 18 | anchored = true |
| 19 | |
| 20 | [[test]] |
| 21 | name = "ascii-literal-anchored-not" |
| 22 | regex = "a" |
| 23 | haystack = "z" |
| 24 | matches = [] |
| 25 | anchored = true |
| 26 | |
| 27 | [[test]] |
| 28 | name = "anchor-start-end-line" |
| 29 | regex = '(?m)^bar$' |
| 30 | haystack = "foo\nbar\nbaz" |
| 31 | matches = [[4, 7]] |
| 32 | |
| 33 | [[test]] |
| 34 | name = "prefix-literal-match" |
| 35 | regex = '^abc' |
| 36 | haystack = "abc" |
| 37 | matches = [[0, 3]] |
| 38 | |
| 39 | [[test]] |
| 40 | name = "prefix-literal-match-ascii" |
| 41 | regex = '^abc' |
| 42 | haystack = "abc" |
| 43 | matches = [[0, 3]] |
| 44 | unicode = false |
| 45 | utf8 = false |
| 46 | |
| 47 | [[test]] |
| 48 | name = "prefix-literal-no-match" |
| 49 | regex = '^abc' |
| 50 | haystack = "zabc" |
| 51 | matches = [] |
| 52 | |
| 53 | [[test]] |
| 54 | name = "one-literal-edge" |
| 55 | regex = 'abc' |
| 56 | haystack = "xxxxxab" |
| 57 | matches = [] |
| 58 | |
| 59 | [[test]] |
| 60 | name = "terminates" |
| 61 | regex = 'a$' |
| 62 | haystack = "a" |
| 63 | matches = [[0, 1]] |
| 64 | |
| 65 | [[test]] |
| 66 | name = "suffix-100" |
| 67 | regex = '.*abcd' |
| 68 | haystack = "abcd" |
| 69 | matches = [[0, 4]] |
| 70 | |
| 71 | [[test]] |
| 72 | name = "suffix-200" |
| 73 | regex = '.*(?:abcd)+' |
| 74 | haystack = "abcd" |
| 75 | matches = [[0, 4]] |
| 76 | |
| 77 | [[test]] |
| 78 | name = "suffix-300" |
| 79 | regex = '.*(?:abcd)+' |
| 80 | haystack = "abcdabcd" |
| 81 | matches = [[0, 8]] |
| 82 | |
| 83 | [[test]] |
| 84 | name = "suffix-400" |
| 85 | regex = '.*(?:abcd)+' |
| 86 | haystack = "abcdxabcd" |
| 87 | matches = [[0, 9]] |
| 88 | |
| 89 | [[test]] |
| 90 | name = "suffix-500" |
| 91 | regex = '.*x(?:abcd)+' |
| 92 | haystack = "abcdxabcd" |
| 93 | matches = [[0, 9]] |
| 94 | |
| 95 | [[test]] |
| 96 | name = "suffix-600" |
| 97 | regex = '[^abcd]*x(?:abcd)+' |
| 98 | haystack = "abcdxabcd" |
| 99 | matches = [[4, 9]] |