mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			15 lines
		
	
	
	
		
			308 B
		
	
	
	
		
			Python
		
	
	
	
	
	
			
		
		
	
	
			15 lines
		
	
	
	
		
			308 B
		
	
	
	
		
			Python
		
	
	
	
	
	
| # Tests StringIO and cStringIO
 | |
| 
 | |
| import string
 | |
| 
 | |
| def do_test(module):
 | |
|     s = (string.letters+'\n')*5
 | |
|     f = module.StringIO(s)
 | |
|     print f.read(10)
 | |
|     print f.readline()
 | |
|     print len(f.readlines(60))
 | |
| 
 | |
| # Don't bother testing cStringIO without
 | |
| import StringIO, cStringIO
 | |
| do_test(StringIO)
 | |
| do_test(cStringIO)
 | 
