示例#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)
示例#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)
示例#3
0
 def test_counting(self):
     result = transduce(transducer=counting(),
                        reducer=expecting_single(),
                        iterable="The quick brown fox jumped".split())
     self.assertEqual(result, 5)
示例#4
0
 def test_counting(self):
     result = transduce(transducer=counting(),
                        reducer=expecting_single(),
                        iterable="The quick brown fox jumped".split())
     self.assertEqual(result, 5)