mirror of
https://github.com/falk-werner/webfuse
synced 2025-06-13 12:54:15 +00:00
added tests of json writer
This commit is contained in:
parent
6c5ff67720
commit
b15130cda6
@ -194,3 +194,22 @@ TEST(json_writer, write_deep_nested_array)
|
|||||||
|
|
||||||
ASSERT_EQ(expected, writer.take());
|
ASSERT_EQ(expected, writer.take());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(json_writer, write_bytes)
|
||||||
|
{
|
||||||
|
writer writer;
|
||||||
|
wf_impl_json_write_bytes(writer, "\0\0", 2);
|
||||||
|
|
||||||
|
ASSERT_EQ("\"AAA\"", writer.take());
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(json_writer, reset)
|
||||||
|
{
|
||||||
|
writer writer;
|
||||||
|
wf_impl_json_write_string(writer, "some value");
|
||||||
|
|
||||||
|
wf_impl_json_writer_reset(writer);
|
||||||
|
wf_impl_json_write_int(writer,42);
|
||||||
|
|
||||||
|
ASSERT_EQ("42", writer.take());
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user