1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 12:48:10 +00:00

AK: Fix JsonValue copy constructor behavior for 64-bit values

The fact that JsonValues can contain 64-bit values isn't a JavaScript
compatible behavior in the first place, but as long as we're supporting
this, we should make sure it works correctly.
This commit is contained in:
Andreas Kling 2020-07-06 17:17:46 +02:00
parent 655f4daeb1
commit ecd4c6718e
2 changed files with 11 additions and 3 deletions

View file

@ -128,4 +128,12 @@ TEST_CASE(json_utf8_multibyte)
EXPECT_EQ(json.as_string() == "\xc5\xa1", true);
}
TEST_CASE(json_64_bit_value)
{
auto big_value = 0x12345678aabbccddull;
JsonValue big_json_value(big_value);
JsonValue big_json_value_copy = big_json_value;
EXPECT_EQ(big_json_value.as_u64(), big_json_value_copy.as_u64());
}
TEST_MAIN(JSON)