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

Method test_head_option

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

Source from the content-addressed store, hash-verified

147 l.head()
148
149 def test_head_option(self):
150 l = self.seq([1, 2, 3]).map(lambda x: x)
151 self.assertEqual(l.head_option(), 1)
152 l = self.seq([[1, 2], 3, 4]).map(lambda x: x)
153 self.assertEqual(l.head_option(), [1, 2])
154 self.assert_type(l.head_option())
155 l = self.seq([])
156 self.assertIsNone(l.head_option())
157
158 def test_last(self):
159 l = self.seq([1, 2, 3]).map(lambda x: x)

Callers

nothing calls this directly

Calls 3

assert_typeMethod · 0.95
mapMethod · 0.80
head_optionMethod · 0.80

Tested by

no test coverage detected