Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: test/compiled/String.cpp

Issue 29722755: Issue 6378 - [emscripten] Make DependentString constexpr
Patch Set: Added test case. Created March 14, 2018, 4:39 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « compiled/String.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/compiled/String.cpp
diff --git a/test/compiled/String.cpp b/test/compiled/String.cpp
index b42a879704e7aedd9c81a58a9b1c5ce1fb0382e3..a668cb3402d99626f0f7f0c2632bd2839e99fa04 100644
--- a/test/compiled/String.cpp
+++ b/test/compiled/String.cpp
@@ -21,6 +21,14 @@
ABP_NS_USING
+TEST(TestString, checkConstexprCorrectness)
+{
+ static constexpr DependentString s(u"Hello world!");
+ static_assert(s.length() == 12, "Length should be 12");
+
+ EXPECT_FALSE(s.is_writable());
sergei 2018/03/14 16:57:44 I wonder whether it should be static_assert too.
René Jeschke 2018/03/14 17:01:00 Yeah, was thinking about this, too. I wasn't sure
sergei 2018/03/14 17:03:09 I think it's fine, JIC technically it's possible.
René Jeschke 2018/03/14 17:12:22 Done.
+}
+
TEST(TestString, constructInvalidDependentString)
{
DependentString s;
« no previous file with comments | « compiled/String.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld