def test_number_sequence_from_0_to_10(self): self.assertDictEqual( sources.range().to_dictionary(lambda k: k, lambda k: k % 2 == 0), { 0: True, 1: False, 2: True, 3: False, 4: True, 5: False, 6: True, 7: False, 8: True, 9: False })
def test_number_sequence_from_0_to_10(self): self.assertEqual(sources.range().max(), 9)
def test_number_sequence_from_0_to_10(self): self.assertTrue(sources.range().any_matches(lambda k: k < 1000))
def test_number_sequence_from_0_to_10(self): self.assertDictEqual(sources.range().group_by(lambda k: k % 2), { 0: [0, 2, 4, 6, 8], 1: [1, 3, 5, 7, 9] })
def test_number_sequence_from_0_to_10(self): self.assertTupleEqual(sources.range().statistics(), NumberStatistics(45, 10, 0, 9, 4.5))
def test_number_sequence_from_0_to_10(self): self.assertListEqual(sources.range().to_list(), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
def test_number_sequence_from_0_to_10(self): self.assertEqual(sources.range().join(), '0123456789')
def test_number_sequence_from_0_to_10(self): self.assertListEqual(sources.range().chunk(3).to_list(), [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9]])
def test_number_sequence_from_0_to_10(self): self.assertListEqual(forEachOpHelper(sources.range()), [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])