diff options
author | Marco Bubke <marco.bubke@qt.io> | 2018-08-30 17:37:12 +0200 |
---|---|---|
committer | Marco Bubke <marco.bubke@qt.io> | 2018-09-03 14:26:05 +0000 |
commit | 3d9974db95a78d3a023abf37d4c1b180430c6fb7 (patch) | |
tree | 4a66503037202bea5abbdf61e216054d63d23303 /tests/unit/unittest/smallstring-test.cpp | |
parent | 4c88c1808cddc2f134203e62b276f2f413e455c6 (diff) | |
download | qt-creator-3d9974db95a78d3a023abf37d4c1b180430c6fb7.tar.gz |
Utils: Fix small string
Change-Id: I6a746eb28c6c803b9ade9f626a950cf93ba6fe99
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Diffstat (limited to 'tests/unit/unittest/smallstring-test.cpp')
-rw-r--r-- | tests/unit/unittest/smallstring-test.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/unit/unittest/smallstring-test.cpp b/tests/unit/unittest/smallstring-test.cpp index ee55d875a7..1f1e704d88 100644 --- a/tests/unit/unittest/smallstring-test.cpp +++ b/tests/unit/unittest/smallstring-test.cpp @@ -1657,6 +1657,15 @@ TEST(SmallString, StringViewPlusOperator) ASSERT_THAT(result, "text and more text"); } +TEST(SmallString, StringViewPlusOperatorReverseOrder) +{ + SmallStringView text = " and more text"; + + auto result = "text" + text; + + ASSERT_THAT(result, "text and more text"); +} + TEST(SmallString, StringPlusOperator) { SmallString text = "text"; @@ -1666,6 +1675,15 @@ TEST(SmallString, StringPlusOperator) ASSERT_THAT(result, "text and more text"); } +TEST(SmallString, StringPlusOperatorReverseOrder) +{ + SmallString text = " and more text"; + + auto result = "text" + text; + + ASSERT_THAT(result, "text and more text"); +} + TEST(SmallString, ShortStringCapacity) { ASSERT_THAT(SmallString().shortStringCapacity(), 30); |