[squeak-dev] The Inbox: Tests-jcg.76.mcz

commits at source.squeak.org commits at source.squeak.org
Thu Apr 15 23:41:50 UTC 2010


A new version of Tests was added to project The Inbox:
http://source.squeak.org/inbox/Tests-jcg.76.mcz

==================== Summary ====================

Name: Tests-jcg.76
Author: jcg
Time: 15 April 2010, 4:41:40.982 pm
UUID: b7ac736c-4238-4f08-aac0-4dc5a1bcf2b7
Ancestors: Tests-ul.75

Add a test for file-truncation.

=============== Diff against Tests-ul.75 ===============

Item was added:
+ ----- Method: FileStreamTest>>testFileTruncation (in category 'as yet unclassified') -----
+ testFileTruncation
+ 	"Ensure that nextChunkPut:/nextChunk works properly on a caching file"
+ 	| file |
+ 	file := nil.
+ 	[	
+ 		file := FileDirectory default forceNewFileNamed: 'TruncationTest.txt'.
+ 		file nextPutAll: '1234567890'.
+ 	] ensure: [file close].
+ 	[
+ 		file := FileDirectory default oldFileNamed: 'TruncationTest.txt'.
+ 		self should: [file contents = '1234567890'].
+ 		file truncate: 4.
+ 	] ensure: [file close].
+ 	[
+ 		file := FileDirectory default readOnlyFileNamed: 'TruncationTest.txt'.
+ 		self should: [file contents = '1234'].
+ 	] ensure: [
+ 		file close.
+ 		FileDirectory default deleteFileNamed: file name ifAbsent:[]
+ 	].
+ !




More information about the Squeak-dev mailing list