mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-08 23:42:53 +03:00
Test: Fix json parse test from unicode string
This commit is contained in:
parent
00edc89288
commit
df8fd4e8c8
Notes:
sideshowbarker
2024-07-19 05:37:18 +09:00
Author: https://github.com/asliturk Commit: https://github.com/SerenityOS/serenity/commit/df8fd4e8c83 Pull-request: https://github.com/SerenityOS/serenity/pull/2541
@ -100,12 +100,22 @@ TEST_CASE(json_empty_string)
|
||||
EXPECT_EQ(json.as_string().is_empty(), true);
|
||||
}
|
||||
|
||||
TEST_CASE(json_utf8_character)
|
||||
TEST_CASE(json_string)
|
||||
{
|
||||
auto json = JsonValue::from_string("\"\xc3\x84\"").value();
|
||||
auto json = JsonValue::from_string("\"A\"").value();
|
||||
EXPECT_EQ(json.type(), JsonValue::Type::String);
|
||||
EXPECT_EQ(json.as_string().is_null(), false);
|
||||
EXPECT_EQ(json.as_string().length(), size_t { 2 });
|
||||
EXPECT_EQ(json.as_string().length(), size_t { 1 });
|
||||
EXPECT_EQ(json.as_string() == "A", true);
|
||||
}
|
||||
|
||||
TEST_CASE(json_utf8_character)
|
||||
{
|
||||
auto json = JsonValue::from_string("\"\\u0041\"").value();
|
||||
EXPECT_EQ(json.type(), JsonValue::Type::String);
|
||||
EXPECT_EQ(json.as_string().is_null(), false);
|
||||
EXPECT_EQ(json.as_string().length(), size_t { 1 });
|
||||
EXPECT_EQ(json.as_string() == "A", true);
|
||||
}
|
||||
|
||||
TEST_MAIN(JSON)
|
||||
|
Loading…
Reference in New Issue
Block a user