MCPcopy Create free account
hub / github.com/boostorg/json / testCompare

Method testCompare

test/string.cpp:2114–2134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2112 }
2113
2114 void
2115 testCompare()
2116 {
2117 test_vectors const t;
2118 string const v1 = t.v1;
2119
2120 // compare(string)
2121 BOOST_TEST(v1.compare(string("aaaaaaa")) > 0);
2122 BOOST_TEST(v1.compare(string(t.v1)) == 0);
2123 BOOST_TEST(v1.compare(string("bbbbbbb")) < 0);
2124
2125 // compare(char const*)
2126 BOOST_TEST(v1.compare("aaaaaaa") > 0);
2127 BOOST_TEST(v1.compare(t.s1.c_str()) == 0);
2128 BOOST_TEST(v1.compare("bbbbbbb") < 0);
2129
2130 // compare(string_view s)
2131 BOOST_TEST(v1.compare(string_view("aaaaaaa")) > 0);
2132 BOOST_TEST(v1.compare(t.v1) == 0);
2133 BOOST_TEST(v1.compare(string_view("bbbbbbb")) < 0);
2134 }
2135
2136 void
2137 testStartEndsWith()

Callers

nothing calls this directly

Calls 4

string_viewClass · 0.85
c_strMethod · 0.80
stringClass · 0.50
compareMethod · 0.45

Tested by

no test coverage detected