summaryrefslogtreecommitdiff
path: root/AK/Tests
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-07-06 17:17:46 +0200
committerAndreas Kling <kling@serenityos.org>2020-07-06 18:38:08 +0200
commitecd4c6718ee4d1dd7f7ded22c3717a6fabec406d (patch)
treeb2431194ee30086d4f49a98314b1cd4886fd487b /AK/Tests
parent655f4daeb1c88dfd38736b78cac697aab6e709f3 (diff)
downloadserenity-ecd4c6718ee4d1dd7f7ded22c3717a6fabec406d.zip
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.
Diffstat (limited to 'AK/Tests')
-rw-r--r--AK/Tests/TestJSON.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/AK/Tests/TestJSON.cpp b/AK/Tests/TestJSON.cpp
index 31dc2c508f..ba196e4cdb 100644
--- a/AK/Tests/TestJSON.cpp
+++ b/AK/Tests/TestJSON.cpp
@@ -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)