diff --git a/src/exp.h b/src/exp.h index 33c4b7b..0b2b306 100644 --- a/src/exp.h +++ b/src/exp.h @@ -69,7 +69,7 @@ inline const RegEx& Hex() { inline const RegEx& NotPrintable() { static const RegEx e = RegEx(0) | - RegEx("\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x7F", REGEX_OR) | + RegEx("\x01\x02\x03\x04\x05\x06\x07\x08\x0B\x0C\x0D\x7F", REGEX_OR) | RegEx(0x0E, 0x1F) | (RegEx('\xC2') + (RegEx('\x80', '\x84') | RegEx('\x86', '\x9F'))); return e; diff --git a/test/integration/emitter_test.cpp b/test/integration/emitter_test.cpp index 04adadf..0ed5392 100644 --- a/test/integration/emitter_test.cpp +++ b/test/integration/emitter_test.cpp @@ -1127,6 +1127,13 @@ TEST_F(EmitterTest, SingleChar) { ExpectEmit("- a\n- \":\"\n- \"\\x10\"\n- \"\\n\"\n- \" \"\n- \"\\t\""); } +TEST_F(EmitterTest, EscepeCharOnMap) { + out << BeginMap; + out << Key << "key" << Value << "\rvalue"; + out << EndMap; + ExpectEmit("key: \"\\rvalue\""); +} + TEST_F(EmitterTest, DefaultPrecision) { out << BeginSeq; out << 1.3125f;