forked from weaselab/weaseljson
Add simple unescaping test
This commit is contained in:
1 parent
fc747f96df
commit
5ae8d4343c
1 file changed
+11
@@ -208,6 +208,17 @@ TEST_CASE("parser3") {
|
||||
|
||||
TEST_CASE("streaming") { testStreaming(json); }
|
||||
|
||||
TEST_CASE("unescaping") {
|
||||
auto c = noopCallbacks();
|
||||
c.on_string_data = +[](void *, const char *buf, int len) {
|
||||
CHECK(std::string(buf, len) == "\n");
|
||||
};
|
||||
std::string copy = "\"\\n\"";
|
||||
parser3::Parser3 parser(&c, nullptr);
|
||||
CHECK(parser.parse(copy.data(), copy.length()) == parser3::S_AGAIN);
|
||||
CHECK(parser.parse(nullptr, 0) == parser3::S_OK);
|
||||
}
|
||||
|
||||
TEST_CASE("bench3") {
|
||||
auto c = noopCallbacks();
|
||||
ankerl::nanobench::Bench bench;
|
||||
|
||||
Reference in new issue
Block a user