Skip to content

Commit

Permalink
Fix non-deterministic test on OTP27 (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
sabiwara committed May 26, 2024
1 parent 4479adb commit 6930220
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/encode_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,13 @@ defmodule Jason.EncoderTest do
end

test "pretty: true" do
assert to_json(%{a: 3.14159, b: 1}, pretty: true) == ~s|{\n "a": 3.14159,\n "b": 1\n}|
object = Jason.OrderedObject.new(a: 3.14159, b: 1)
assert to_json(object, pretty: true) == ~s|{\n "a": 3.14159,\n "b": 1\n}|
end

test "pretty: false" do
assert to_json(%{a: 3.14159, b: 1}, pretty: false) == ~s|{"a":3.14159,"b":1}|
object = Jason.OrderedObject.new(a: 3.14159, b: 1)
assert to_json(object, pretty: false) == ~s|{"a":3.14159,"b":1}|
end

defp to_json(value) do
Expand Down

0 comments on commit 6930220

Please sign in to comment.