From 3e53605a312b17d2b922431c1ba8675f04dd0149 Mon Sep 17 00:00:00 2001 From: Simon Gene Gottlieb Date: Tue, 17 Feb 2026 22:10:02 +0100 Subject: [PATCH] test: fixes test for NBSP (non-break space) This fixes the example "Example 5.13 Escaped Characters" from the YAML specification. The example demands that `\_` is being translated to unicode `\u00a0`. The unicode codepoint `\u00A0` encoded for utf-8 in hex is `\xC2\xA0`. Fixing this test case will cause the unit test to not pass, since the codepoint `\u00A0` is not handled correctly. (Failing unittest is expected). --- test/integration/handler_spec_test.cpp | 2 +- test/integration/node_spec_test.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/test/integration/handler_spec_test.cpp b/test/integration/handler_spec_test.cpp index 8cba902..0f87bb9 100644 --- a/test/integration/handler_spec_test.cpp +++ b/test/integration/handler_spec_test.cpp @@ -751,7 +751,7 @@ TEST_F(HandlerSpecTest, Ex5_13_EscapedCharacters) { OnScalar(_, "!", 0, "Fun with \x5C \x22 \x07 \x08 \x1B \x0C \x0A \x0D \x09 \x0B " + std::string("\x00", 1) + - " \x20 \xA0 \x85 \xe2\x80\xa8 \xe2\x80\xa9 A A A")); + " \x20 \xC2\xA0 \x85 \xe2\x80\xa8 \xe2\x80\xa9 A A A")); EXPECT_CALL(handler, OnDocumentEnd()); Parse(ex5_13); } diff --git a/test/integration/node_spec_test.cpp b/test/integration/node_spec_test.cpp index bfc8578..127a28c 100644 --- a/test/integration/node_spec_test.cpp +++ b/test/integration/node_spec_test.cpp @@ -467,7 +467,7 @@ TEST(NodeSpecTest, Ex5_13_EscapedCharacters) { EXPECT_TRUE(doc.as() == "Fun with \x5C \x22 \x07 \x08 \x1B \x0C \x0A \x0D \x09 \x0B " + std::string("\x00", 1) + - " \x20 \xA0 \x85 \xe2\x80\xa8 \xe2\x80\xa9 A A A"); + " \x20 \xC2\xA0 \x85 \xe2\x80\xa8 \xe2\x80\xa9 A A A"); } TEST(NodeSpecTest, Ex5_14_InvalidEscapedCharacters) {