Exemple #1
0
 def test_single4(self):
     linq = Linq([1, 1, 2, 3, 5])
     assert_equal(linq.single(cond_f=lambda x: x % 2 == 0), 2)
Exemple #2
0
 def test_single2(self):
     linq = Linq([])
     linq.single()
Exemple #3
0
 def test_single3(self):
     linq = Linq([1, 2])
     linq.single()
Exemple #4
0
 def test_single(self):
     linq = Linq([1])
     assert_equal(linq.single(), 1)
     assert_equal(linq.single(), 1)