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

Function Y_UNIT_TEST

util/generic/strbuf_ut.cpp:8–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6
7Y_UNIT_TEST_SUITE(TStrBufTest) {
8 Y_UNIT_TEST(TestConstructorsAndOperators) {
9 TStringBuf str("qwerty");
10
11 UNIT_ASSERT_EQUAL(*str.data(), 'q');
12 UNIT_ASSERT_EQUAL(str.size(), 6);
13
14 TStringBuf str1("qwe\0rty"sv);
15 TStringBuf str2(str1.data());
16 UNIT_ASSERT_VALUES_UNEQUAL(str1, str2);
17 UNIT_ASSERT_VALUES_EQUAL(str1.size(), 7);
18 UNIT_ASSERT_VALUES_EQUAL(str2.size(), 3);
19
20 std::string_view helloWorld("Hello, World!");
21 TStringBuf fromStringView(helloWorld);
22 UNIT_ASSERT_EQUAL(fromStringView.data(), helloWorld.data());
23 UNIT_ASSERT_EQUAL(fromStringView.size(), helloWorld.size());
24
25 std::string_view fromStringBuf = fromStringView;
26 UNIT_ASSERT_EQUAL(helloWorld.data(), fromStringBuf.data());
27 UNIT_ASSERT_EQUAL(helloWorld.size(), fromStringBuf.size());
28 }
29
30 Y_UNIT_TEST(TestConstExpr) {
31 static constexpr TStringBuf str1("qwe\0rty", 7);

Callers

nothing calls this directly

Calls 15

PassByConstReferenceFunction · 0.85
TestContainsImplFunction · 0.85
AfterMethod · 0.80
BeforeMethod · 0.80
RAfterMethod · 0.80
RBeforeMethod · 0.80
AfterPrefixMethod · 0.80
SkipPrefixMethod · 0.80
BeforeSuffixMethod · 0.80
ChopSuffixMethod · 0.80
ChopMethod · 0.80
SplitOffMethod · 0.80

Tested by

no test coverage detected