diff options
| author | zi-m <zi.m.github.com@gmail.com> | 2019-08-29 20:39:11 +0200 |
|---|---|---|
| committer | zi-m <zi.m.github.com@gmail.com> | 2019-08-29 20:39:11 +0200 |
| commit | 7fd21c5d827c2d77b21270646c2fe53704245747 (patch) | |
| tree | 2e6c8a4e482c6093acec724a9ec6d1efb5207bd7 /toolsrc/src/vcpkg-test/stringview.cpp | |
| parent | 94d52ecffe377a3d11f626d84a2da9ca5c60be9a (diff) | |
| parent | f5c732b40d43f062278f247036b773477823813b (diff) | |
| download | vcpkg-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.cpp | 17 |
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")); +} |
