MCPcopy Create free account
hub / github.com/EntilZha/PyFunctional / test_tails

Method test_tails

functional/test/test_functional.py:190–194  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

188 self.assertIteratorEqual(l.inits().map(lambda s: s.sum()), [6, 3, 1, 0])
189
190 def test_tails(self):
191 l = self.seq([1, 2, 3]).map(lambda x: x)
192 expect = [[1, 2, 3], [2, 3], [3], []]
193 self.assertIteratorEqual(l.tails(), expect)
194 self.assertIteratorEqual(l.tails().map(lambda s: s.sum()), [6, 5, 3, 0])
195
196 def test_drop(self):
197 s = self.seq([1, 2, 3, 4, 5, 6])

Callers

nothing calls this directly

Calls 4

assertIteratorEqualMethod · 0.95
mapMethod · 0.80
tailsMethod · 0.80
sumMethod · 0.80

Tested by

no test coverage detected