forked from cp-algorithms/cp-algorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_main_lorentz.cpp
More file actions
44 lines (39 loc) · 875 Bytes
/
test_main_lorentz.cpp
File metadata and controls
44 lines (39 loc) · 875 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include <cassert>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
#include "main_lorentz.h"
int main() {
find_repetitions("acababaee");
sort(repetitions.begin(), repetitions.end());
vector<pair<int, int>> expected = {
{2, 5},
{3, 6},
{7, 8}
};
assert(expected == repetitions);
repetitions.clear();
find_repetitions("abaaba");
sort(repetitions.begin(), repetitions.end());
expected = {
{0, 5},
{2, 3}
};
assert(expected == repetitions);
repetitions.clear();
find_repetitions("aaaaaa");
sort(repetitions.begin(), repetitions.end());
expected = {
{0, 1},
{0, 3},
{0, 5},
{1, 2},
{1, 4},
{2, 3},
{2, 5},
{3, 4},
{4, 5},
};
assert(expected == repetitions);
}