The Trunk: Tests-jcg.76.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Tests-jcg.76.mcz

commits-2
Andreas Raab uploaded a new version of Tests to project The Trunk:
http://source.squeak.org/trunk/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:[]
+ ].
+ !