mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Added a test for the StringIO write() error I just fixed.
This commit is contained in:
		
							parent
							
								
									b636dc67ed
								
							
						
					
					
						commit
						22d5895dc3
					
				
					 2 changed files with 9 additions and 0 deletions
				
			
		|  | @ -3,6 +3,7 @@ abcdefghij | ||||||
| klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ | klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ | ||||||
| 
 | 
 | ||||||
| 2 | 2 | ||||||
|  | 'abcuvwxyz!' | ||||||
| 'abcdefghij' | 'abcdefghij' | ||||||
| 'abcde' | 'abcde' | ||||||
| Caught expected ValueError writing to closed StringIO: | Caught expected ValueError writing to closed StringIO: | ||||||
|  | @ -11,6 +12,7 @@ abcdefghij | ||||||
| klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ | klmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ | ||||||
| 
 | 
 | ||||||
| 2 | 2 | ||||||
|  | 'abcuvwxyz!' | ||||||
| 'abcdefghij' | 'abcdefghij' | ||||||
| 'abcde' | 'abcde' | ||||||
| Caught expected ValueError writing to closed StringIO: | Caught expected ValueError writing to closed StringIO: | ||||||
|  |  | ||||||
|  | @ -7,6 +7,13 @@ def do_test(module): | ||||||
|     print f.readline() |     print f.readline() | ||||||
|     print len(f.readlines(60)) |     print len(f.readlines(60)) | ||||||
| 
 | 
 | ||||||
|  |     f = module.StringIO() | ||||||
|  |     f.write('abcdef') | ||||||
|  |     f.seek(3) | ||||||
|  |     f.write('uvwxyz') | ||||||
|  |     f.write('!') | ||||||
|  |     print `f.getvalue()` | ||||||
|  |     f.close() | ||||||
|     f = module.StringIO() |     f = module.StringIO() | ||||||
|     f.write(s) |     f.write(s) | ||||||
|     f.seek(10) |     f.seek(10) | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Guido van Rossum
						Guido van Rossum