MCPcopy Create free account
hub / github.com/catboost/catboost / TestSpn

Method TestSpn

util/string/util_ut.cpp:12–24  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10
11public:
12 void TestSpn() {
13 str_spn rul("a-z", true);
14 char s[] = "!@#$ab%^&c+-";
15 UNIT_ASSERT_EQUAL(rul.brk(s), s + 4);
16 UNIT_ASSERT_EQUAL(rul.brk(s + 4), s + 4);
17 UNIT_ASSERT_EQUAL(rul.brk(s + 10), s + 12);
18 char* s1 = s;
19 UNIT_ASSERT_EQUAL(strcmp(rul.sep(s1), "!@#$"), 0);
20 UNIT_ASSERT_EQUAL(strcmp(rul.sep(s1), ""), 0);
21 UNIT_ASSERT_EQUAL(strcmp(rul.sep(s1), "%^&"), 0);
22 UNIT_ASSERT_EQUAL(strcmp(rul.sep(s1), "+-"), 0);
23 UNIT_ASSERT_EQUAL(rul.sep(s1), nullptr);
24 }
25
26 void TestRemoveAll() {
27 static const struct T {

Callers

nothing calls this directly

Calls 3

strcmpFunction · 0.85
brkMethod · 0.80
sepMethod · 0.80

Tested by

no test coverage detected