Commit 6cf6fc66 authored by Stefan Behnel's avatar Stefan Behnel

updated test case

parent 248e8d06
...@@ -132,6 +132,19 @@ def multiplied_lists_nonconst(x): ...@@ -132,6 +132,19 @@ def multiplied_lists_nonconst(x):
True True
>>> multiplied_lists_nonconst(0) == [1,2,3] * 0 >>> multiplied_lists_nonconst(0) == [1,2,3] * 0
True True
>>> [1,2,3] * 'abc'
Traceback (most recent call last):
TypeError: can't multiply sequence by non-int of type 'str'
>>> multiplied_nonconst_tuple_arg('abc') # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: can't multiply sequence by non-int of type 'str'
>>> [1,2,3] * 1.0
Traceback (most recent call last):
TypeError: can't multiply sequence by non-int of type 'float'
>>> multiplied_nonconst_tuple_arg(1.0) # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: can't multiply sequence by non-int of type 'float'
""" """
return [1,2,3] * x return [1,2,3] * x
...@@ -191,6 +204,23 @@ def multiplied_nonconst_tuple_arg(x): ...@@ -191,6 +204,23 @@ def multiplied_nonconst_tuple_arg(x):
""" """
>>> multiplied_nonconst_tuple_arg(5) == (1,2) * 5 >>> multiplied_nonconst_tuple_arg(5) == (1,2) * 5
True True
>>> multiplied_nonconst_tuple_arg(-5) == (1,2) * -5
True
>>> multiplied_nonconst_tuple_arg(0) == (1,2) * 0
True
>>> (1,2) * 'abc'
Traceback (most recent call last):
TypeError: can't multiply sequence by non-int of type 'str'
>>> multiplied_nonconst_tuple_arg('abc') # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: can't multiply sequence by non-int of type 'str'
>>> (1,2) * 1.0
Traceback (most recent call last):
TypeError: can't multiply sequence by non-int of type 'float'
>>> multiplied_nonconst_tuple_arg(1.0) # doctest: +ELLIPSIS
Traceback (most recent call last):
TypeError: can't multiply sequence by non-int of type 'float'
""" """
return (1,2) * x return (1,2) * x
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment