From b3d607bfdf8ffbe0bcc117756c9177ebf8b67974 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 24 Nov 2026 22:18:59 +0000 Subject: [PATCH] Fix string escapes in the PrivateBin test Co-Authored-By: Claude Sonnet 5.5 --- tests/privatebin_test.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tests/privatebin_test.cpp b/tests/privatebin_test.cpp index 5cda52a..6012e84 100644 --- a/tests/privatebin_test.cpp +++ b/tests/privatebin_test.cpp @@ -35,14 +35,12 @@ TEST_CASE("PrivateBin encodings and paste round trip") { CHECK(privatebin::base64(crypto::Bytes{'f', 'o', 'o'}) == "Zm9v"); CHECK(privatebin::base58(crypto::Bytes{0, 0, 1}) == "112"); CHECK(privatebin::base58(crypto::Bytes{'h', 'e', 'l', 'l', 'o'}) == "Cn8eVZg"); - std::string text = "report café "quoted" \ tab -"; - for (int i = 0; i < 2000; ++i) text += "12345.678 I [launch] repeated log line " + std::to_string(i) + " -"; + std::string text = "report caf\xC3\xA9 \"quoted\" \\ tab\t\n"; + for (int i = 0; i < 2000; ++i) text += "12345.678 I [launch] repeated log line " + std::to_string(i) + "\n"; auto enc = privatebin::encrypt(text, "1month"); CHECK(privatebin::decrypt(enc.body, enc.fragment) == text); auto other = privatebin::encrypt(text, "1month"); CHECK_THROWS(privatebin::decrypt(enc.body, other.fragment)); - auto odd = privatebin::encrypt("bad byte ÿþ here", "1day"); + auto odd = privatebin::encrypt("bad byte \xFF\xFE here", "1day"); CHECK(privatebin::decrypt(odd.body, odd.fragment).starts_with("bad byte")); }