예제 #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)
예제 #2
0
 def test_single2(self):
     linq = Linq([])
     linq.single()
예제 #3
0
 def test_single3(self):
     linq = Linq([1, 2])
     linq.single()
예제 #4
0
 def test_single(self):
     linq = Linq([1])
     assert_equal(linq.single(), 1)
     assert_equal(linq.single(), 1)