@@ -368,6 +368,21 @@ def test_same_sets_same_hash(self):
368368 t2_hash = DeepHashPrep (t2 )
369369
370370 assert t1_hash [get_id (t1 )] == t2_hash [get_id (t2 )]
371+
372+ @pytest .mark .parametrize ("list1, list2, ignore_list_order, is_equal" , [
373+ ([1 , 2 ], [2 , 1 ], False , False ),
374+ ([1 , 2 ], [2 , 1 ], True , True ),
375+ ([1 , 2 , 3 ], [1 , 3 , 2 ], False , False ),
376+ ([1 , [1 , 2 , 3 ]], [1 , [3 , 2 , 1 ]], False , False ),
377+ ([1 , [1 , 2 , 3 ]], [1 , [3 , 2 , 1 ]], True , True ),
378+ ((1 , 2 ), (2 , 1 ), False , False ),
379+ ((1 , 2 ), (2 , 1 ), True , True ),
380+ ])
381+ def test_list_ignore_order (self , list1 , list2 , ignore_list_order , is_equal ):
382+ list1_hash = DeepHash (list1 , ignore_list_order = ignore_list_order )
383+ list2_hash = DeepHash (list2 , ignore_list_order = ignore_list_order )
384+
385+ assert is_equal == (list1_hash [list1 ] == list2_hash [list2 ])
371386
372387 @pytest .mark .parametrize ("t1, t2, significant_digits, number_format_notation, result" , [
373388 ({0.012 , 0.98 }, {0.013 , 0.99 }, 1 , "f" , 'set:float:0.0,float:1.0' ),
0 commit comments