18#define TEST_STR "test string"
19 void CtStringTest::testConstruction ()
25 void CtStringTest::testUnsizedConstruction ()
27 constexpr auto getStr = [] ()
constexpr {
return TEST_STR; };
33 void CtStringTest::testUDL ()
35 constexpr auto s =
"test string"_ct;
39 void CtStringTest::testConcat ()
41 constexpr auto s1 =
"hello, "_ct;
42 constexpr auto s2 =
"world!"_ct;
43 constexpr auto s3 =
" how's life?"_ct;
45 constexpr auto concat = s1 + s2 + s3;
46 const QString expected {
"hello, world! how's life?" };
49 QCOMPARE (
ToString<
"hello, "_ct +
"world!" +
" how's life?"> (), expected);
51 QCOMPARE (
ToString<
"hello, " +
"world!"_ct +
" how's life?"> (), expected);
54 void CtStringTest::testNub ()
56 constexpr static std::tuple input {
"hello"_ct,
"world"_ct,
"hello"_ct,
"lc"_ct,
"what's"_ct,
"up"_ct,
"lc"_ct,
"lc"_ct };
57 constexpr std::tuple expected {
"hello"_ct,
"world"_ct,
"lc"_ct,
"what's"_ct,
"up"_ct };
59 constexpr static auto F = [&] {
return input; };
60 constexpr auto nubbed =
Nub<F>();
61 static_assert (nubbed == expected);
66 constexpr auto str =
"hello, " +
"world!"_ct +
" how's life?";
constexpr size_t StringBufSize(const Char *str) noexcept
CtString(RawStr< N, Char >) -> CtString< N - 1, Char >