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

Function test

code/strings/kmp.test.cpp:14–26  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12}
13
14void test() {
15 rep(it,0,8000) {
16 string a = rand_string(1, 50),
17 b = rand_string(1, 10000);
18 size_t x = b.find(a);
19 int ans = string_match(b, a);
20 if (x == string::npos) {
21 assert_equal(-1, ans);
22 } else {
23 assert_equal((int)x, ans);
24 }
25 }
26}
27// vim: cc=60 ts=2 sts=2 sw=2:

Callers

nothing calls this directly

Calls 4

rand_stringFunction · 0.85
string_matchFunction · 0.85
assert_equalFunction · 0.50
findMethod · 0.45

Tested by

no test coverage detected