MCPcopy Create free account
hub / github.com/SuprDewd/CompetitiveProgramming / make_sure_ok

Function make_sure_ok

code/strings/suffix_array.test.cpp:26–51  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24};
25
26void make_sure_ok(string s) {
27 // s = s + "~";
28 suffix_array sa1(s);
29 naive_suffix_array sa2(s);
30
31 // for (int i = 0; i < size(s); i++) {
32 // cout << s.substr(sa1.idx[i]) << endl;
33 // }
34
35 // cout << endl;
36 // for (int i = 0; i < size(s); i++) {
37 // cout << s.substr(sa2.idx[i]) << endl;
38 // }
39
40 // cout << endl;
41
42 for (int i = 0; i < size(s); i++) {
43
44 assert_equal(sa1.idx[i], sa2.idx[i]);
45
46 if (sa1.idx[i] != sa2.idx[i])
47 {
48 cout << s << endl;
49 }
50 }
51}
52
53void test() {
54 make_sure_ok("GATAGACA");

Callers 1

testFunction · 0.85

Calls 1

assert_equalFunction · 0.50

Tested by

no test coverage detected