| 8 | #include "main_lorentz.h" |
| 9 | |
| 10 | int main() { |
| 11 | find_repetitions("acababaee"); |
| 12 | sort(repetitions.begin(), repetitions.end()); |
| 13 | vector<pair<int, int>> expected = { |
| 14 | {2, 5}, |
| 15 | {3, 6}, |
| 16 | {7, 8} |
| 17 | }; |
| 18 | assert(expected == repetitions); |
| 19 | |
| 20 | repetitions.clear(); |
| 21 | find_repetitions("abaaba"); |
| 22 | sort(repetitions.begin(), repetitions.end()); |
| 23 | expected = { |
| 24 | {0, 5}, |
| 25 | {2, 3} |
| 26 | }; |
| 27 | assert(expected == repetitions); |
| 28 | |
| 29 | repetitions.clear(); |
| 30 | find_repetitions("aaaaaa"); |
| 31 | sort(repetitions.begin(), repetitions.end()); |
| 32 | expected = { |
| 33 | {0, 1}, |
| 34 | {0, 3}, |
| 35 | {0, 5}, |
| 36 | {1, 2}, |
| 37 | {1, 4}, |
| 38 | {2, 3}, |
| 39 | {2, 5}, |
| 40 | {3, 4}, |
| 41 | {4, 5}, |
| 42 | }; |
| 43 | assert(expected == repetitions); |
| 44 | } |
nothing calls this directly
no outgoing calls
no test coverage detected