Index: test/compiled/String.cpp |
diff --git a/test/compiled/String.cpp b/test/compiled/String.cpp |
index b42a879704e7aedd9c81a58a9b1c5ce1fb0382e3..4faaf02aed0bfa2154bda58439cb7183451b12ef 100644 |
--- a/test/compiled/String.cpp |
+++ b/test/compiled/String.cpp |
@@ -21,6 +21,23 @@ |
ABP_NS_USING |
+TEST(TestString, checkConstexprCorrectness) |
+{ |
+ static constexpr DependentString s(u"Hello world!"); |
+ static constexpr DependentString s2; |
+ |
+ static_assert(s.length() == 12, "Length should be 12"); |
+ |
+ 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] == 'H', "First character should be 'H'"); |
+ static_assert(s[1] == 'e', "Second character should be 'e'"); |
+ |
+ static_assert(s2.is_invalid(), "String should be invalid"); |
+} |
+ |
TEST(TestString, constructInvalidDependentString) |
{ |
DependentString s; |