From f3cef796b2594c86908e2bb87eb852995dbc8777 Mon Sep 17 00:00:00 2001 From: sabiwara Date: Sun, 26 May 2024 12:54:27 +0900 Subject: [PATCH] Fix non-deterministic test on OTP27 --- test/encode_test.exs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/test/encode_test.exs b/test/encode_test.exs index 8ed77cd..86cdbe4 100644 --- a/test/encode_test.exs +++ b/test/encode_test.exs @@ -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