diff options
author | Rami Ali <flowergrass@users.noreply.github.com> | 2017-01-17 16:03:30 +1100 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-01-17 16:21:17 +1100 |
commit | 5314219f182e8a303e3fa68e2bacca978cb08002 (patch) | |
tree | 882cf1d50b0343b9bb74ea533cd77c39a83efae9 | |
parent | cba723fc8c9b76150efc95e54996ad12a9a8cfc6 (diff) | |
download | micropython-5314219f182e8a303e3fa68e2bacca978cb08002.tar.gz micropython-5314219f182e8a303e3fa68e2bacca978cb08002.zip |
tests/basics: Improve runtime.c test coverage.
-rw-r--r-- | tests/basics/fun_calldblstar3.py | 3 | ||||
-rw-r--r-- | tests/basics/fun_callstar.py | 5 | ||||
-rw-r--r-- | tests/basics/iter0.py | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/tests/basics/fun_calldblstar3.py b/tests/basics/fun_calldblstar3.py index 4367e68df7..b796d52c7e 100644 --- a/tests/basics/fun_calldblstar3.py +++ b/tests/basics/fun_calldblstar3.py @@ -5,7 +5,8 @@ def foo(**kw): class Mapping: def keys(self): - return ['a', 'b', 'c'] + # the long string checks the case of string interning + return ['a', 'b', 'c', 'abcdefghijklmnopqrst'] def __getitem__(self, key): if key == 'a': diff --git a/tests/basics/fun_callstar.py b/tests/basics/fun_callstar.py index 2275d3d4fc..a27a288a3c 100644 --- a/tests/basics/fun_callstar.py +++ b/tests/basics/fun_callstar.py @@ -17,6 +17,11 @@ foo(*range(3)) # pos then iterator foo(1, *range(2, 4)) +# an iterator with many elements +def foo(*rest): + print(rest) +foo(*range(10)) + # method calls with *pos class A: diff --git a/tests/basics/iter0.py b/tests/basics/iter0.py index 6110e8fa58..d20ade7fee 100644 --- a/tests/basics/iter0.py +++ b/tests/basics/iter0.py @@ -4,3 +4,6 @@ try: pass except TypeError: print('TypeError') + +# builtin type that is iterable, calling __next__ explicitly +print(iter(range(4)).__next__()) |