Added more test cases

master
Aadhavan Srinivasan 2 months ago
parent 19dc5064c8
commit fd957d9518

@ -87,6 +87,13 @@ var reTests = []struct {
{`\bint\b`, "print int integer", []matchIndex{{6, 9}}},
{`int(\b|a)`, "inta", []matchIndex{{0, 4}}},
{`\b\d+\b`, "511 a3 43", []matchIndex{{0, 3}, {7, 9}}},
{`\Bint\B`, "prints int integer print", []matchIndex{{2, 5}}},
{`^`, "5^3^2", []matchIndex{{0, 0}}},
{`\^`, "5^3^2", []matchIndex{{1, 2}, {3, 4}}},
{`pool$`, "pool carpool", []matchIndex{{8, 12}}},
{`^int$`, "print int integer", []matchIndex{}},
{`^int$`, "int", []matchIndex{{0, 3}}},
{`b*`, "aaaaaaaaaaqweqwe", []matchIndex{{0, 0}, {1, 1}, {2, 2}, {3, 3}, {4, 4}, {5, 5}, {6, 6}, {7, 7}, {8, 8}, {9, 9}, {10, 10}, {11, 11}, {12, 12}, {13, 13}, {14, 14}, {15, 15}, {16, 16}}},
}
func TestFindAllMatches(t *testing.T) {

Loading…
Cancel
Save