@@ -149,6 +149,8 @@ def test_groupby(self):
149149 self .assertTrue (0 in parity and 1 in parity , 'created a group for each value' )
150150 self .assertEqual (_ (parity [0 ]).join (', ' ), '2, 4, 6' , 'put each even number in the right group' )
151151
152+ self .assertEqual (_ .groupBy ([1 ], lambda num , * args : num ), [1 ])
153+
152154 llist = ["one" , "two" , "three" , "four" , "five" , "six" , "seven" , "eight" , "nine" , "ten" ]
153155 grouped = _ .groupBy (llist , lambda x , * args : len (x ))
154156 self .assertEqual (_ (grouped [3 ]).join (' ' ), 'one two six ten' )
@@ -160,6 +162,8 @@ def test_countby(self):
160162 self .assertEqual (parity [True ], 2 )
161163 self .assertEqual (parity [False ], 3 )
162164
165+ self .assertEqual (_ .countBy ([1 ], lambda num , * args : num ), 1 )
166+
163167 llist = ["one" , "two" , "three" , "four" , "five" , "six" , "seven" , "eight" , "nine" , "ten" ]
164168 grouped = _ .countBy (llist , lambda x , * args : len (x ))
165169 self .assertEqual (grouped [3 ], 4 )
@@ -216,6 +220,8 @@ def test_indexBy(self):
216220 self .assertEqual (parity [True ], 4 )
217221 self .assertEqual (parity [False ], 5 )
218222
223+ self .assertEqual (_ .indexBy ([1 ], lambda num , * args : num ), 1 )
224+
219225 llist = ["one" , "two" , "three" , "four" , "five" , "six" , "seven" , "eight" , "nine" , "ten" ]
220226 grouped = _ .indexBy (llist , lambda x , * args : len (x ))
221227 self .assertEqual (grouped [3 ], 'ten' )
0 commit comments