| Index: test/compiled/String.cpp |
| diff --git a/test/compiled/String.cpp b/test/compiled/String.cpp |
| index e969ccde556eb61d9b3b67a6303fca1eddec8b9b..4ce2c321e649f07699c1b29408911eca63329a47 100644 |
| --- a/test/compiled/String.cpp |
| +++ b/test/compiled/String.cpp |
| @@ -21,6 +21,45 @@ |
| ABP_NS_USING |
| +constexpr void checkConstexprTemplateCtor() |
| +{ |
| + constexpr DependentString s(u"Test string"); |
| +} |
| + |
| +constexpr void checkConstexprInvalidCtor() |
| +{ |
| + constexpr DependentString s; |
| + static_assert(s.is_invalid(), "String should be invalid"); |
| +} |
| + |
| +constexpr void checkConstexprCtor() |
| +{ |
| + constexpr DependentString s(u"Test string", 11); |
| +} |
| + |
| +constexpr void checkConstexprFuncsAndOps() |
| +{ |
| + constexpr DependentString s = u"Test string"_str; |
| + constexpr DependentString s2 = u"Test string"_str; |
| + constexpr DependentString s3 = u"Another test string"_str; |
| + |
| + static_assert(s.length() == s2.length(), "Length should be equal"); |
| + static_assert(s.equals(s2), "Strings should be equal"); |
| + static_assert(s == s2, "Strings should be equal"); |
| + static_assert(s != s3, "Strings should not be equal"); |
| + |
| + static_assert(!s.empty(), "String should not be empty"); |
| + static_assert(!s.is_writable(), "String should not be writable"); |
| + static_assert(!s.is_deleted(), "String should not be deleted"); |
| + |
| + static_assert(s.data()[0] == 'T', "First character should be 'T'"); |
| + static_assert(s[1] == 'e', "Second character should be 'e'"); |
| + |
| + static_assert(s.find(u'e') == 1, "'e' should be at pos 1"); |
| + static_assert(s.find(s2) == 0, "String should be found at pos 0"); |
| + static_assert(s.rfind(u'e') == 1, "'e' should be at pos 1"); |
| +} |
| + |
| TEST(TestString, constructInvalidDependentString) |
| { |
| DependentString s; |