Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/SelfTest/IntrospectiveTests
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-05-10 07:22:11 +0200
committerMartin Hořeňovský2020-05-10 07:22:11 +0200
commit895d0a06960d9f48190dde7c7aa4a56d614946fc (patch)
tree47f966785fdfb5e29bef60fb215e9fc78f184ec7 /tests/SelfTest/IntrospectiveTests
parent094d840efe51bf1b06679d9c281e7e1513db2c81 (diff)
downloadcatch3-895d0a06960d9f48190dde7c7aa4a56d614946fc.tar.gz
Small improvements for StringRef
* `operator[]` is constexpr * `operator<<` and `operator+=` are hidden friends
Diffstat (limited to 'tests/SelfTest/IntrospectiveTests')
-rw-r--r--tests/SelfTest/IntrospectiveTests/String.tests.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/tests/SelfTest/IntrospectiveTests/String.tests.cpp b/tests/SelfTest/IntrospectiveTests/String.tests.cpp
index ae1cc817..e616801c 100644
--- a/tests/SelfTest/IntrospectiveTests/String.tests.cpp
+++ b/tests/SelfTest/IntrospectiveTests/String.tests.cpp
@@ -126,8 +126,6 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) {
}
TEST_CASE("StringRef at compilation time", "[Strings][StringRef][constexpr]") {
- //TODO:
- // * substr
using Catch::StringRef;
SECTION("Simple constructors") {
constexpr StringRef empty{};
@@ -144,6 +142,7 @@ TEST_CASE("StringRef at compilation time", "[Strings][StringRef][constexpr]") {
STATIC_REQUIRE(stringref.begin() != stringref.end());
STATIC_REQUIRE(stringref.substr(10, 0).empty());
STATIC_REQUIRE(stringref.substr(2, 1).data() == abc + 2);
+ STATIC_REQUIRE(stringref[1] == 'b');
constexpr StringRef shortened(abc, 2);