Skip to content

Commit a2726cb

Browse files
committed
Test against both JSON.dump and Float#to_s
1 parent a1cdac1 commit a2726cb

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

test/json/json_ryu_fallback_test.rb

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,11 +134,12 @@ def test_subnormal_edge_cases_round_trip
134134
# Parse the number
135135
result = JSON.parse(input)
136136

137-
# Re-parse to verify round-trip
138-
result2 = JSON.parse(result.to_s)
137+
# Should be bit-identical
138+
assert_equal(result, JSON.parse(result.to_s),
139+
"Subnormal #{input} failed round-trip test")
139140

140141
# Should be bit-identical
141-
assert_equal(result, result2,
142+
assert_equal(result, JSON.parse(JSON.dump(result)),
142143
"Subnormal #{input} failed round-trip test")
143144

144145
# Verify the value is in the expected subnormal range

0 commit comments

Comments
 (0)