mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Add tests for char in string -- including required exceptions for
non-char in string.
This commit is contained in:
parent
2663c13c5b
commit
da2361ac1d
1 changed files with 23 additions and 0 deletions
|
@ -39,3 +39,26 @@ try:
|
|||
check(0, "not in base_set did not raise error")
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
# Test char in string
|
||||
|
||||
check('c' in 'abc', "'c' not in 'abc'")
|
||||
check('d' not in 'abc', "'d' in 'abc'")
|
||||
|
||||
try:
|
||||
'' in 'abc'
|
||||
check(0, "'' in 'abc' did not raise error")
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
try:
|
||||
'ab' in 'abc'
|
||||
check(0, "'ab' in 'abc' did not raise error")
|
||||
except TypeError:
|
||||
pass
|
||||
|
||||
try:
|
||||
None in 'abc'
|
||||
check(0, "None in 'abc' did not raise error")
|
||||
except TypeError:
|
||||
pass
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue