2929 [True , False ] * 50 ,
3030 "UltraFastList([True, False, True, ..., False, True, False])" ,
3131 ),
32- ('__repr__' , 'bool' , [True , False ], 'UltraFastList([True, False])' ),
33- ('__repr__' , 'float' , [1.0 , 2.0 ], 'UltraFastList([1.0, 2.0])' ),
34- ('__repr__' , 'float' , range (0 , 100 ),
35- 'UltraFastList([0.0, 1.0, 2.0, ..., 97.0, 98.0, 99.0])' ),
36- ('__repr__' , 'int' , [1 , 2 ], 'UltraFastList([1, 2])' ),
37- ('__repr__' , 'int' , range (0 , 100 ),
38- 'UltraFastList([0, 1, 2, ..., 97, 98, 99])' ),
32+ (
33+ '__repr__' ,
34+ 'bool' ,
35+ [True , False ],
36+ 'UltraFastList([True, False])' ,
37+ ),
38+ (
39+ '__repr__' ,
40+ 'float' ,
41+ [1.0 , 2.0 ],
42+ 'UltraFastList([1.0, 2.0])' ,
43+ ),
44+ (
45+ '__repr__' ,
46+ 'float' ,
47+ range (0 , 100 ),
48+ 'UltraFastList([0.0, 1.0, 2.0, ..., 97.0, 98.0, 99.0])' ,
49+ ),
50+ (
51+ '__repr__' ,
52+ 'int' ,
53+ [1 , 2 ],
54+ 'UltraFastList([1, 2])' ,
55+ ),
56+ (
57+ '__repr__' ,
58+ 'int' ,
59+ range (0 , 100 ),
60+ 'UltraFastList([0, 1, 2, ..., 97, 98, 99])' ,
61+ ),
3962 (
4063 "__repr__" ,
4164 "string" ,
4265 ['foo' , 'bar' ] * 50 ,
4366 "UltraFastList(['foo', 'bar', 'foo', ..., 'bar', 'foo', 'bar'])" ,
4467 ),
45- ('__repr__' , 'string' , ['foo' , 'bar' ],
46- "UltraFastList(['foo', 'bar'])" ),
68+ (
69+ '__repr__' ,
70+ 'string' ,
71+ ['foo' , 'bar' ],
72+ "UltraFastList(['foo', 'bar'])" ,
73+ ),
4774 (
4875 "__repr__" ,
4976 "string" ,
5077 ['foo' , None ] * 50 ,
5178 "UltraFastList(['foo', None, 'foo', ..., None, 'foo', None])" ,
5279 ),
53- ('__repr__' , 'string' , ['foo' , None ],
54- "UltraFastList(['foo', None])" ),
80+ (
81+ '__repr__' ,
82+ 'string' ,
83+ ['foo' , None ],
84+ "UltraFastList(['foo', None])" ,
85+ ),
5586
5687 (
5788 "__str__" ,
5889 "bool" ,
5990 [True , False ] * 50 ,
6091 "[True, False, True, ..., False, True, False]" ,
6192 ),
62- ('__str__' , 'bool' , [True , False ], '[True, False]' ),
63- ('__str__' , 'float' , [1.0 , 2.0 ], '[1.0, 2.0]' ),
64- ('__str__' , 'float' , range (0 , 100 ),
65- '[0.0, 1.0, 2.0, ..., 97.0, 98.0, 99.0]' ),
66- ('__str__' , 'int' , [1 , 2 ], '[1, 2]' ),
67- ('__str__' , 'int' , range (0 , 100 ), '[0, 1, 2, ..., 97, 98, 99]' ),
93+ (
94+ '__str__' ,
95+ 'bool' ,
96+ [True , False ],
97+ '[True, False]' ,
98+ ),
99+ (
100+ '__str__' ,
101+ 'float' ,
102+ [1.0 , 2.0 ],
103+ '[1.0, 2.0]' ,
104+ ),
105+ (
106+ '__str__' ,
107+ 'float' ,
108+ range (0 , 100 ),
109+ '[0.0, 1.0, 2.0, ..., 97.0, 98.0, 99.0]' ,
110+ ),
111+ (
112+ '__str__' ,
113+ 'int' ,
114+ [1 , 2 ],
115+ '[1, 2]' ,
116+ ),
117+ (
118+ '__str__' ,
119+ 'int' ,
120+ range (0 , 100 ),
121+ '[0, 1, 2, ..., 97, 98, 99]' ,
122+ ),
68123 (
69124 "__str__" ,
70125 "string" ,
71126 ['foo' , 'bar' ] * 50 ,
72127 "['foo', 'bar', 'foo', ..., 'bar', 'foo', 'bar']" ,
73128 ),
74- ('__str__' , 'string' , ['foo' , 'bar' ], "['foo', 'bar']" ),
129+ (
130+ '__str__' ,
131+ 'string' ,
132+ ['foo' , 'bar' ],
133+ "['foo', 'bar']" ,
134+ ),
75135 (
76136 "__str__" ,
77137 "string" ,
78138 ['foo' , None ] * 50 ,
79139 "['foo', None, 'foo', ..., None, 'foo', None]" ,
80140 ),
81- ('__str__' , 'string' , ['foo' , None ], "['foo', None]" ),
141+ (
142+ '__str__' ,
143+ 'string' ,
144+ ['foo' , None ],
145+ "['foo', None]" ,
146+ ),
82147
83148 ('copy' , 'bool' , [True , False ], [True , False ]),
84149 ('copy' , 'float' , [1.0 , 2.0 ], [1.0 , 2.0 ]),
@@ -150,6 +215,24 @@ def test_methods_no_arg(
150215 ('__getitem__' , 'string' , ['foo' , 'bar' , 'baz' ],
151216 ['foo' , 'baz' ], {'index' : ul .IndexList ([0 , 2 ])}),
152217
218+ ("all_equal" , 'bool' , [True , False ], True , {"other" : [True , False ]}),
219+ ("all_equal" , 'bool' , [True , False ], False , {"other" : [True , True ]}),
220+ ("all_equal" , 'bool' , [True , False ], False , {"other" : [False , True ]}),
221+ ("all_equal" , 'bool' , [True , False ], False , {"other" : [False , False ]}),
222+ ("all_equal" , 'bool' , [True , False ], False , {"other" : [True , None ]}),
223+ ("all_equal" , 'bool' , [True , None ], False , {"other" : [True , None ]}),
224+ ("all_equal" , 'bool' , [True , None ], False , {"other" : [True , False ]}),
225+ ("all_equal" , 'bool' , [True , False ], False , {"other" : [True ]}),
226+ ("all_equal" , 'bool' , [True , False ], False , {"other" : [None ]}),
227+ ("all_equal" , 'float' , [1.0 , 0.0 ], True , {"other" : [1.0 , 0.0 ]}),
228+ ("all_equal" , 'float' , [1.0 , 0.0 ], False , {"other" : [1.0 , 1.0 ]}),
229+ ("all_equal" , 'int' , [1 , 0 ], True , {"other" : [1 , 0 ]}),
230+ ("all_equal" , 'int' , [1 , 0 ], False , {"other" : [1 , 1 ]}),
231+ ("all_equal" , 'string' , ['foo' , 'bar' ],
232+ True , {"other" : ['foo' , 'bar' ]}),
233+ ("all_equal" , 'string' , ['foo' , 'bar' ],
234+ False , {"other" : ['foo' , 'foo' ]}),
235+
153236 ("apply" , "bool" , [True , False ], [
154237 False , True ], {"fn" : lambda x : x == False },), # noqa: E712
155238 ("apply" , "float" , [1.0 , 2.0 ], [
@@ -160,7 +243,6 @@ def test_methods_no_arg(
160243 ("apply" , "string" , ['foo' , 'bar' , None ], [
161244 True , False , True ], {"fn" : lambda x : x != 'bar' },),
162245
163-
164246 ("equal_scala" , 'bool' , [True , False ], [False , True ], {"elem" : False }),
165247 ("equal_scala" , 'float' , [1.0 , 2.0 , 3.0 ],
166248 [False , True , False ], {"elem" : 2.0 }),
@@ -274,7 +356,11 @@ def test_methods_with_args(
274356 kwargs : dict ,
275357) -> None :
276358 arr = ul .from_seq (nums , dtype )
277- result = getattr (arr , test_method )(** kwargs )
359+ fn = getattr (arr , test_method )
360+ if kwargs .get ("other" ) and isinstance (kwargs ["other" ], list ):
361+ result = fn (ul .from_seq (kwargs ["other" ], dtype ))
362+ else :
363+ result = fn (** kwargs )
278364 check_test_result (dtype , test_method , result , expected_value )
279365
280366
0 commit comments