diff --git a/test/impl/string_obfs.cpp b/test/impl/string_obfs.cpp new file mode 100644 index 0000000..c160b80 --- /dev/null +++ b/test/impl/string_obfs.cpp @@ -0,0 +1,16 @@ +#include +#include + +TEST_CASE("xor string obfs", "[StringObfs]") { + using byte = unsigned char; + + auto xor = [](byte key) constexpr { + return [=](char c) constexpr -> char { + return c ^ key; + }; + }; + + REQUIRE( + make_stringobfs("Hello World !", xor(0x20), xor(0x20)).decode() + == std::string_view("Hello World !")); +} \ No newline at end of file