From be68a43c2475d8442a65b32b9ed46d15585e39a8 Mon Sep 17 00:00:00 2001 From: Bob Ippolito Date: Thu, 21 Mar 2024 10:10:55 -0700 Subject: [PATCH] Fix mochijson2 test that was map-order dependent --- src/mochijson2.erl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mochijson2.erl b/src/mochijson2.erl index 57933e5b..4a524379 100644 --- a/src/mochijson2.erl +++ b/src/mochijson2.erl @@ -966,8 +966,9 @@ decode_map_test() -> ?assertEqual(M, decode(Json, [{format, map}])). encode_map_test() -> - M = <<"{\"a\":1,\"b\":{\"c\":2}}">>, - ?assertEqual(M, iolist_to_binary(encode(#{a => 1, b => #{ c => 2}}))). + ?assertEqual(<<"{\"a\":1}">>, iolist_to_binary(encode(#{a => 1}))), + M = #{<<"a">> => 1, <<"b">> => #{<<"c">> => 2}}, + ?assertEqual(M, decode(iolist_to_binary(encode(#{a => 1, b => #{ c => 2}})), [{format, map}])). encode_empty_map_test() -> ?assertEqual(<<"{}">>, encode(#{})).