add test for iter.first and iter.last

This commit is contained in:
Prodesire 2018-02-03 00:02:49 +08:00
parent 5da517dbdb
commit 47531166cb
1 changed files with 15 additions and 0 deletions

15
tests/test_iter.py Normal file
View File

@ -0,0 +1,15 @@
import pytest
from pydu.iter import first, last
@pytest.mark.parametrize(
'iterable', (
[1, 2],
(1, 2),
{1, 2},
{1: 1, 2: 2},
iter([1, 2])
))
def test_first_last(iterable):
assert first(iterable) == 1
assert last(iterable) == 2