Skip to content

Commit 5314219

Browse files
flowergrassdpgeorge
authored andcommitted
tests/basics: Improve runtime.c test coverage.
1 parent cba723f commit 5314219

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

tests/basics/fun_calldblstar3.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ def foo(**kw):
55

66
class Mapping:
77
def keys(self):
8-
return ['a', 'b', 'c']
8+
# the long string checks the case of string interning
9+
return ['a', 'b', 'c', 'abcdefghijklmnopqrst']
910

1011
def __getitem__(self, key):
1112
if key == 'a':

tests/basics/fun_callstar.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ def foo(a, b, c):
1717
# pos then iterator
1818
foo(1, *range(2, 4))
1919

20+
# an iterator with many elements
21+
def foo(*rest):
22+
print(rest)
23+
foo(*range(10))
24+
2025
# method calls with *pos
2126

2227
class A:

tests/basics/iter0.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
pass
55
except TypeError:
66
print('TypeError')
7+
8+
# builtin type that is iterable, calling __next__ explicitly
9+
print(iter(range(4)).__next__())

0 commit comments

Comments
 (0)