LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File 0613-Fix-array-tests-hardcoded-to-node-leaf-sizes.patch of Package erlang (Project home:Ledest:erlang:20)

From df0142c1da4966728f7b37fa779a1003b22fd72e Mon Sep 17 00:00:00 2001
From: Richard Carlsson <richardc@klarna.com>
Date: Mon, 11 Mar 2019 16:16:42 +0100
Subject: [PATCH 4/4] Fix array tests hardcoded to node/leaf sizes

---
 lib/stdlib/src/array.erl | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/lib/stdlib/src/array.erl b/lib/stdlib/src/array.erl
index 32bc2a3372..1504326c61 100644
--- a/lib/stdlib/src/array.erl
+++ b/lib/stdlib/src/array.erl
@@ -1632,12 +1632,11 @@ foldl_test_() ->
      ?_assert(foldl(Sum, 0, from_list(lists:seq(0,10))) =:= 55),
      ?_assert(foldl(Reverse, [], from_list(lists:seq(0,1000)))
 	      =:= lists:reverse(lists:seq(0,1000))),
-     ?_assert({999,[N0*100+1+2,N0*2+1+1,0]} =:= 
-	      foldl(Vals, {0,[]}, 
+     ?_assertEqual({N0*100+1-2,[N0*100+1+2,N0*2+1+1,0]},
+	      foldl(Vals, {0,[]},
 		    set(N0*100+1,2,
 			set(N0*2+1,1,
 			    set(0,0,new())))))
-     
     ].
 -endif.
 
@@ -1787,12 +1786,11 @@ foldr_test_() ->
      ?_assert(foldr(Sum, 0, from_list(lists:seq(0,10))) =:= 55),
      ?_assert(foldr(List, [], from_list(lists:seq(0,1000)))
  	      =:= lists:seq(0,1000)),
-     ?_assert({999,[0,N0*2+1+1,N0*100+1+2]} =:= 
-	      foldr(Vals, {0,[]}, 
+     ?_assertEqual({N0*100+1-2,[0,N0*2+1+1,N0*100+1+2]},
+	      foldr(Vals, {0,[]},
 		    set(N0*100+1,2,
 			set(N0*2+1,1,
 			    set(0,0,new())))))
-     
     ].
 -endif.
 
-- 
2.16.4