MCPcopy Create free account
hub / github.com/comaps/comaps / UNIT_TEST

Function UNIT_TEST

libs/base/base_tests/uni_string_dfa_test.cpp:11–64  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace
10{
11UNIT_TEST(UniStringDFA_Smoke)
12{
13 {
14 UniStringDFA dfa("");
15
16 auto it = dfa.Begin();
17 TEST(it.Accepts(), ());
18 TEST(!it.Rejects(), ());
19
20 DFAMove(it, "a");
21 TEST(!it.Accepts(), ());
22 TEST(it.Rejects(), ());
23 }
24
25 {
26 UniStringDFA dfa("абв");
27
28 auto it = dfa.Begin();
29 TEST(!it.Accepts(), ());
30 TEST(!it.Rejects(), ());
31
32 DFAMove(it, "а");
33 TEST(!it.Accepts(), ());
34 TEST(!it.Rejects(), ());
35
36 DFAMove(it, "б");
37 TEST(!it.Accepts(), ());
38 TEST(!it.Rejects(), ());
39
40 DFAMove(it, "в");
41 TEST(it.Accepts(), ());
42 TEST(!it.Rejects(), ());
43
44 DFAMove(it, "г");
45 TEST(!it.Accepts(), ());
46 TEST(it.Rejects(), ());
47 }
48
49 {
50 UniStringDFA dfa("абв");
51
52 auto it = dfa.Begin();
53 TEST(!it.Accepts(), ());
54 TEST(!it.Rejects(), ());
55
56 DFAMove(it, "а");
57 TEST(!it.Accepts(), ());
58 TEST(!it.Rejects(), ());
59
60 DFAMove(it, "г");
61 TEST(!it.Accepts(), ());
62 TEST(it.Rejects(), ());
63 }
64}
65
66UNIT_TEST(UniStringDFA_Prefix)
67{

Callers

nothing calls this directly

Calls 6

TESTFunction · 0.85
DFAMoveFunction · 0.85
UniStringDFAClass · 0.50
BeginMethod · 0.45
AcceptsMethod · 0.45
RejectsMethod · 0.45

Tested by

no test coverage detected