Esempio n. 1
0
 def test_counting_with_predicate(self):
     result = transduce(transducer=counting(lambda w: 'o' in w),
                        reducer=expecting_single(),
                        iterable="The quick brown fox jumped".split())
     self.assertEqual(result, 2)
Esempio n. 2
0
 def test_counting_with_predicate(self):
     result = transduce(transducer=counting(lambda w: 'o' in w),
                        reducer=expecting_single(),
                        iterable="The quick brown fox jumped".split())
     self.assertEqual(result, 2)
Esempio n. 3
0
 def test_counting(self):
     result = transduce(transducer=counting(),
                        reducer=expecting_single(),
                        iterable="The quick brown fox jumped".split())
     self.assertEqual(result, 5)
Esempio n. 4
0
 def test_counting(self):
     result = transduce(transducer=counting(),
                        reducer=expecting_single(),
                        iterable="The quick brown fox jumped".split())
     self.assertEqual(result, 5)