tests/basics: Improve runtime.c test coverage.

pull/2654/merge
Rami Ali 2017-01-17 16:03:30 +11:00 zatwierdzone przez Damien George
rodzic cba723fc8c
commit 5314219f18
3 zmienionych plików z 10 dodań i 1 usunięć

Wyświetl plik

@ -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':

Wyświetl plik

@ -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:

Wyświetl plik

@ -4,3 +4,6 @@ try:
pass
except TypeError:
print('TypeError')
# builtin type that is iterable, calling __next__ explicitly
print(iter(range(4)).__next__())