summaryrefslogtreecommitdiffhomepage
path: root/FoundationEx/test/Text.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'FoundationEx/test/Text.cpp')
-rw-r--r--FoundationEx/test/Text.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/FoundationEx/test/Text.cpp b/FoundationEx/test/Text.cpp
index 7400eb1..deaf742 100644
--- a/FoundationEx/test/Text.cpp
+++ b/FoundationEx/test/Text.cpp
@@ -31,7 +31,7 @@ TEST(FoundationEx, TextCanBeCopied)
TEST(FoundationEx, ConcatenateTextWithLiteralWithoutSideEffects)
{
- const Text a {"Hello"};
+ Text a {"Hello"};
const auto b = a + ", there";
ASSERT_EQ("Hello", a);
ASSERT_EQ("Hello, there", b);
@@ -41,7 +41,25 @@ TEST(FoundationEx, ConcatenateTextWithLiteralWithoutSideEffects)
TEST(FoundationEx, ReplaceInTextWithoutSideEffects)
{
Text a {"Hello, all"};
- const auto b = a.replace("Hello", "Goodbye"); // Test::replace should be const
+ const auto b = a.replace("Hello", "Goodbye");
ASSERT_EQ("Hello, all", a);
ASSERT_EQ("Goodbye, all", b);
}
+
+
+TEST(FoundationEx, SubstringFromTextWithoutSideEffects)
+{
+ Text a {"Hello, all"};
+ const auto b = a.substring(7, 3);
+ ASSERT_EQ("Hello, all", a);
+ ASSERT_EQ("all", b);
+}
+
+
+TEST(FoundationEx, TrimTextWithoutSideEffects)
+{
+ Text a {" Hi! "};
+ const auto b = a.trim();
+ ASSERT_EQ(" Hi! ", a);
+ ASSERT_EQ("Hi!", b);
+}