diff --git a/Sources/Tests/CoreTests/test_plString.cpp b/Sources/Tests/CoreTests/test_plString.cpp index 3d2768a1..970e2522 100644 --- a/Sources/Tests/CoreTests/test_plString.cpp +++ b/Sources/Tests/CoreTests/test_plString.cpp @@ -85,6 +85,22 @@ TEST(plString, Utility) EXPECT_EQ(utf8_test_data_length, plString(utf8_test_data).GetSize()); } +TEST(plString, StackStrings) +{ + char stack_buf[256]; + strcpy(stack_buf, "Test"); + plString test(stack_buf); + + EXPECT_EQ(plString("Test"), test); + EXPECT_EQ(strlen("Test"), test.GetSize()); + + strcpy(stack_buf, "operator="); + test = stack_buf; + + EXPECT_EQ(plString("operator="), test); + EXPECT_EQ(strlen("operator="), test.GetSize()); +} + TEST(plString, ConvertUtf8) { // From UTF-8 to plString