9#include "testing/testing.h"
15TEST(string_ref_null, DefaultConstructor)
22TEST(string_ref_null, CStringConstructor)
24 const char *
str =
"Hello";
30TEST(string_ref_null, CStringLengthConstructor)
32 const char *
str =
"Hello";
38TEST(string_ref_null, CompareEqual)
49TEST(string_ref_null, CompareEqualCharPtr1)
58TEST(string_ref_null, CompareEqualCharPtr2)
67TEST(string_ref_null, CompareEqualString1)
76TEST(string_ref_null, CompareEqualString2)
85TEST(string_ref_null, CompareEqualStringRef1)
94TEST(string_ref_null, CompareEqualStringRef2)
108 std::array<int, std::size_t(sref.
find_first_of(
'o'))> compiles = {1};
112TEST(string_ref, DefaultConstructor)
118TEST(string_ref, StartEndConstructor)
120 const char *text =
"hello world";
127TEST(string_ref, StartEndConstructorNullptr)
134TEST(string_ref, StartEndConstructorSame)
136 const char *text =
"hello world";
142TEST(string_ref, CStringConstructor)
144 const char *
str =
"Test";
150TEST(string_ref, PointerWithLengthConstructor)
152 const char *
str =
"Test";
158TEST(string_ref, StdStringConstructor)
160 std::string
str =
"Test";
166TEST(string_ref, SpanConstructor)
172TEST(string_ref, SubscriptOperator)
186 std::string
str = ref;
194 std::stringstream ss;
197 std::string
str = ss.str();
213 std::string
result = ref +
"qwe";
220 std::string
result =
"qwe" + ref;
227 std::string
result = ref + std::string(
"asd");
234 std::string
result = std::string(
"asd") + ref;
249TEST(string_ref, CompareEqualCharPtr1)
258TEST(string_ref, CompareEqualCharPtr2)
267TEST(string_ref, CompareEqualString1)
276TEST(string_ref, CompareEqualString2)
334TEST(string_ref, DropPrefixLargeN)
342TEST(string_ref, DropKnownPrefix)
358TEST(string_ref, DropSuffixLargeN)
381TEST(string_ref, TrimWhitespace)
404TEST(string_ref, TrimLeftArbitrary)
421TEST(string_ref, TrimLeftWhitespace)
433TEST(string_ref, TrimRightArbitrary)
450TEST(string_ref, TrimRightWhitespace)
473TEST(string_ref, CopyUtf8Truncated)
478 memset(dst, 0xFF, 10);
487 memset(dst, 0xFF, 4);
525TEST(string_ref, CopyBytesTruncated)
530 memset(dst, 0xFF, 10);
539 memset(dst, 0xFF, 4);
577TEST(string_ref, FromStringView)
579 std::string_view view =
"hello";
587 std::string_view view = ref;
596 std::array<int, std::size_t(sref.
find_first_of(
'o'))> compiles = {1};
#define BLI_STR_UTF8_SUPERSCRIPT_2
constexpr StringRef drop_prefix(int64_t n) const
constexpr StringRef drop_suffix(int64_t n) const
constexpr StringRef drop_known_prefix(StringRef prefix) const
void append(const T &value)
constexpr int64_t find_first_of(StringRef chars, int64_t pos=0) const
constexpr StringRef trim() const
constexpr bool startswith(StringRef prefix) const
constexpr int64_t size() const
void copy_bytes_truncated(char *dst, int64_t dst_size) const
constexpr StringRef trim_right() const
constexpr StringRef trim_left() const
constexpr StringRef substr(int64_t start, int64_t size) const
constexpr const char * data() const
void copy_utf8_truncated(char *dst, int64_t dst_size) const
constexpr bool endswith(StringRef suffix) const
#define EXPECT_FALSE(result)
#define EXPECT_TRUE(result)
BLI_STATIC_ASSERT(std::is_trivially_constructible_v< float3 >, "")
TEST(any_virtual, DefaultConstructor)
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)