| 92 | } |
| 93 | |
| 94 | void copy() const { |
| 95 | const auto r = assertRegex("begin.*end"); |
| 96 | |
| 97 | int called = 0; |
| 98 | int s = -1; |
| 99 | int e = -1; |
| 100 | auto f = [&](int start, int end) { |
| 101 | ++called; |
| 102 | s = start; |
| 103 | e = end; |
| 104 | }; |
| 105 | |
| 106 | { |
| 107 | // NOLINTNEXTLINE(performance-unnecessary-copy-initialization) |
| 108 | auto r2 = r; |
| 109 | ASSERT_EQUALS("", r2->match("begin-123-end", f)); |
| 110 | ASSERT_EQUALS(1, called); |
| 111 | ASSERT_EQUALS(0, s); |
| 112 | ASSERT_EQUALS(13, e); |
| 113 | } |
| 114 | |
| 115 | called = 0; |
| 116 | s = -1; |
| 117 | e = -1; |
| 118 | ASSERT_EQUALS("", r->match("begin-123-end", f)); |
| 119 | ASSERT_EQUALS(1, called); |
| 120 | ASSERT_EQUALS(0, s); |
| 121 | ASSERT_EQUALS(13, e); |
| 122 | } |
| 123 | |
| 124 | void multimatch() const { |
| 125 | const auto r = assertRegex("info:.*"); |
no test coverage detected