tests/basics: Improve runtime.c test coverage.
This commit is contained in:
parent
cba723fc8c
commit
5314219f18
|
@ -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':
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -4,3 +4,6 @@ try:
|
|||
pass
|
||||
except TypeError:
|
||||
print('TypeError')
|
||||
|
||||
# builtin type that is iterable, calling __next__ explicitly
|
||||
print(iter(range(4)).__next__())
|
||||
|
|
Loading…
Reference in New Issue