File bson-erlang-0.2.4-test.patch of Package bson-erlang

diff -Ndurp bson-erlang-0.2.4/test/bson_tests.erl bson-erlang-0.2.4-test/test/bson_tests.erl
--- bson-erlang-0.2.4/test/bson_tests.erl	2021-05-28 09:51:47.000000000 +0300
+++ bson-erlang-0.2.4-test/test/bson_tests.erl	2023-12-29 12:23:52.024027326 +0200
@@ -109,7 +109,7 @@ maps_put_test() ->
   SimpleMap = #{<<"map">> => true, <<"simple">> => <<"very">>, atom => key, array => [1, 2, 3, 4]},
   Encoded1 = bson_binary:put_document(SimpleMap),
   {Decoded1, <<>>} = bson_binary:get_document(Encoded1),
-  ?assertEqual({<<"array">>, [1, 2, 3, 4], <<"atom">>, key, <<"map">>, true, <<"simple">>, <<"very">>}, Decoded1),
+  ?assertEqual({<<"array">>, [1, 2, 3, 4], <<"atom">>, key, <<"map">>, true, <<"simple">>, <<"very">>}, sort(Decoded1)),
   MapWithMap = #{<<"map">> => true, <<"simple">> => <<"not">>, <<"why">> => #{<<"because">> => <<"with map">>, ok => true}},
   Encoded2 = bson_binary:put_document(MapWithMap),
   {Decoded2, <<>>} = bson_binary:get_document(Encoded2),
@@ -148,3 +148,8 @@ maps_flattering_test() ->
       <<"email">> => <<"test@test.su">>
     },
   ?assertEqual(FlattenMap, Result).
+
+sort(T) -> sort(tuple_to_list(T), []).
+
+sort([K, V|T], A) -> sort(T, [{K, V}|A]);
+sort([], A) -> list_to_tuple(lists:flatmap(fun({K, V}) -> [K, V] end, lists:keysort(1, A))).
openSUSE Build Service is sponsored by