diff options
author | swarmer <swarmer@yandex-team.ru> | 2022-02-10 16:46:31 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:31 +0300 |
commit | 317da38588b7898a99fd9168571408123350012b (patch) | |
tree | 25eebc31526019ad39a6c1b13f492963d97ba439 /util/system/src_root_ut.cpp | |
parent | 3b2241461d41d41ba1a706b0750c4f0f55c344f6 (diff) | |
download | ydb-317da38588b7898a99fd9168571408123350012b.tar.gz |
Restoring authorship annotation for <swarmer@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'util/system/src_root_ut.cpp')
-rw-r--r-- | util/system/src_root_ut.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/util/system/src_root_ut.cpp b/util/system/src_root_ut.cpp index e9a675eb9a..852f9dd668 100644 --- a/util/system/src_root_ut.cpp +++ b/util/system/src_root_ut.cpp @@ -9,19 +9,19 @@ Y_UNIT_TEST_SUITE(TestSourceRoot) { const TString path = TPathSplit(__SOURCE_FILE_IMPL__.As<TStringBuf>()).Reconstruct(); UNIT_ASSERT_EQUAL(path, "util" LOCSLASH_S "system" LOCSLASH_S "src_root_ut.cpp"); } - - Y_UNIT_TEST(TestPrivateChopPrefixRoutine) { - static constexpr const char str[] = ":\0:\0: It's unlikely that this string has an ARCADIA_ROOT as its prefix :\0:\0:"; - static constexpr const auto strStaticBuf = STATIC_BUF(str); + + Y_UNIT_TEST(TestPrivateChopPrefixRoutine) { + static constexpr const char str[] = ":\0:\0: It's unlikely that this string has an ARCADIA_ROOT as its prefix :\0:\0:"; + static constexpr const auto strStaticBuf = STATIC_BUF(str); UNIT_ASSERT_VALUES_EQUAL(TStringBuf(str, sizeof(str) - 1), ::NPrivate::StripRoot(strStaticBuf).As<TStringBuf>()); - UNIT_ASSERT_VALUES_EQUAL(0, ::NPrivate::RootPrefixLength(strStaticBuf)); - - static_assert(::NPrivate::IsProperPrefix(STATIC_BUF("foo"), STATIC_BUF("foobar")), R"(IsProperPrefix("foo", "foobar") failed)"); - static_assert(!::NPrivate::IsProperPrefix(STATIC_BUF("foobar"), STATIC_BUF("foo")), R"(IsProperPrefix("foobar", "foo") failed)"); - static_assert(!::NPrivate::IsProperPrefix(STATIC_BUF("name"), STATIC_BUF("name")), R"(IsProperPrefix("name", "name") failed)"); - static_assert(::NPrivate::IsProperPrefix(STATIC_BUF("name"), STATIC_BUF("name/")), R"(IsProperPrefix("name", "name/") failed)"); - static_assert(::NPrivate::IsProperPrefix(STATIC_BUF(""), STATIC_BUF("foobar")), R"(IsProperPrefix("", "foobar") failed)"); - static_assert(!::NPrivate::IsProperPrefix(STATIC_BUF(""), STATIC_BUF("")), R"(IsProperPrefix("", "") failed)"); - static_assert(::NPrivate::IsProperPrefix(STATIC_BUF("dir"), STATIC_BUF("dir/file")), R"(IsProperPrefix("dir", "dir/file") failed)"); - } + UNIT_ASSERT_VALUES_EQUAL(0, ::NPrivate::RootPrefixLength(strStaticBuf)); + + static_assert(::NPrivate::IsProperPrefix(STATIC_BUF("foo"), STATIC_BUF("foobar")), R"(IsProperPrefix("foo", "foobar") failed)"); + static_assert(!::NPrivate::IsProperPrefix(STATIC_BUF("foobar"), STATIC_BUF("foo")), R"(IsProperPrefix("foobar", "foo") failed)"); + static_assert(!::NPrivate::IsProperPrefix(STATIC_BUF("name"), STATIC_BUF("name")), R"(IsProperPrefix("name", "name") failed)"); + static_assert(::NPrivate::IsProperPrefix(STATIC_BUF("name"), STATIC_BUF("name/")), R"(IsProperPrefix("name", "name/") failed)"); + static_assert(::NPrivate::IsProperPrefix(STATIC_BUF(""), STATIC_BUF("foobar")), R"(IsProperPrefix("", "foobar") failed)"); + static_assert(!::NPrivate::IsProperPrefix(STATIC_BUF(""), STATIC_BUF("")), R"(IsProperPrefix("", "") failed)"); + static_assert(::NPrivate::IsProperPrefix(STATIC_BUF("dir"), STATIC_BUF("dir/file")), R"(IsProperPrefix("dir", "dir/file") failed)"); + } } |