aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg-test/stringview.cpp
diff options
context:
space:
mode:
authorzi-m <zi.m.github.com@gmail.com>2019-08-29 20:39:11 +0200
committerzi-m <zi.m.github.com@gmail.com>2019-08-29 20:39:11 +0200
commit7fd21c5d827c2d77b21270646c2fe53704245747 (patch)
tree2e6c8a4e482c6093acec724a9ec6d1efb5207bd7 /toolsrc/src/vcpkg-test/stringview.cpp
parent94d52ecffe377a3d11f626d84a2da9ca5c60be9a (diff)
parentf5c732b40d43f062278f247036b773477823813b (diff)
downloadvcpkg-7fd21c5d827c2d77b21270646c2fe53704245747.tar.gz
vcpkg-7fd21c5d827c2d77b21270646c2fe53704245747.zip
Merge remote-tracking branch 'upstream/master' into wxchartdir
Diffstat (limited to 'toolsrc/src/vcpkg-test/stringview.cpp')
-rw-r--r--toolsrc/src/vcpkg-test/stringview.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/toolsrc/src/vcpkg-test/stringview.cpp b/toolsrc/src/vcpkg-test/stringview.cpp
new file mode 100644
index 000000000..4df8e6be5
--- /dev/null
+++ b/toolsrc/src/vcpkg-test/stringview.cpp
@@ -0,0 +1,17 @@
+#include <catch2/catch.hpp>
+
+#include <vcpkg/base/stringview.h>
+
+template <std::size_t N>
+static vcpkg::StringView sv(const char (&cstr)[N]) {
+ return cstr;
+}
+
+TEST_CASE("string view operator==", "[stringview]") {
+ // these are due to a bug in operator==
+ // see commit 782723959399a1a0725ac49
+ REQUIRE(sv("hey") != sv("heys"));
+ REQUIRE(sv("heys") != sv("hey"));
+ REQUIRE(sv("hey") == sv("hey"));
+ REQUIRE(sv("hey") != sv("hex"));
+}