[Python-checkins] CVS: python/dist/src/Lib/test test_contains.py,1.1,1.2

Guido van Rossum guido@cnri.reston.va.us
Tue, 7 Mar 2000 10:52:04 -0500 (EST)


Update of /projects/cvsroot/python/dist/src/Lib/test
In directory eric:/projects/python/develop/guido/src/Lib/test

Modified Files:
	test_contains.py 
Log Message:
Add tests for char in string -- including required exceptions for
non-char in string.


Index: test_contains.py
===================================================================
RCS file: /projects/cvsroot/python/dist/src/Lib/test/test_contains.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** test_contains.py	2000/03/06 21:00:29	1.1
--- test_contains.py	2000/03/07 15:52:01	1.2
***************
*** 40,41 ****
--- 40,64 ----
  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