7 SECTION(
"no replacements") {
9 CHECK(replacer(
"") ==
"");
10 CHECK(replacer(
"foo") ==
"foo");
11 CHECK(replacer(
"1234") ==
"1234");
13 SECTION(
"1 replacement") {
16 CHECK(replacer(
"") ==
"");
17 CHECK(replacer(
"foo") ==
"bar");
18 CHECK(replacer(
"1234") ==
"1234");
20 SECTION(
"2 replacements") {
24 CHECK(replacer(
"") ==
"");
25 CHECK(replacer(
"foo") ==
"bar");
26 CHECK(replacer(
"qux") ==
"baz");
27 CHECK(replacer(
"Qux") ==
"Qux");
28 CHECK(replacer(
"1234") ==
"1234");
30 SECTION(
"3 replacements") {
35 CHECK(replacer(
"") ==
"");
36 CHECK(replacer(
"foo") ==
"bar");
37 CHECK(replacer(
"qux") ==
"baz");
38 CHECK(replacer(
"a") ==
"b");
39 CHECK(replacer(
"1234") ==
"1234");
41 SECTION(
"4 replacements") {
47 CHECK(replacer(
"") ==
"");
48 CHECK(replacer(
"foo") ==
"bar");
49 CHECK(replacer(
"qux") ==
"baz");
50 CHECK(replacer(
"a") ==
"b");
51 CHECK(replacer(
"1") ==
"one");
52 CHECK(replacer(
"1234") ==
"1234");
55 SECTION(
"many replacements") {
67 CHECK(replacer(
"1") ==
"one");
68 CHECK(replacer(
"22") ==
"two");
69 CHECK(replacer(
"333") ==
"three");
70 CHECK(replacer(
"4444") ==
"four");
71 CHECK(replacer(
"5") ==
"five");
72 CHECK(replacer(
"6") ==
"six");
73 CHECK(replacer(
"777") ==
"seven");
74 CHECK(replacer(
"8") ==
"eight");
75 CHECK(replacer(
"9") ==
"nine");
76 CHECK(replacer(
"10101010") ==
"ten");
78 CHECK(replacer(
"") ==
"");
79 CHECK(replacer(
"foo") ==
"foo");
80 CHECK(replacer(
"11") ==
"11");
81 CHECK(replacer(
"7") ==
"7");
TEST_CASE("StringReplacer")
constexpr auto create(Args ...args)