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 authored and michalmuskala committed Jun 29, 2024
1 parent 9c3bc4b commit 44fc70a
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 @@ -219,11 +219,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, opts \\ []) do
Expand Down

0 comments on commit 44fc70a

Please sign in to comment.