checkin from browser
authorClaus Gittinger <cg@exept.de>
Tue, 11 Dec 2001 21:12:04 +0100
changeset 129 91f95833c58c
parent 128 ed7f4270d061
child 130 93a0b6e77c51
checkin from browser
RegressionTests__FileOpenTest.st
--- a/RegressionTests__FileOpenTest.st	Tue Dec 11 20:52:22 2001 +0100
+++ b/RegressionTests__FileOpenTest.st	Tue Dec 11 21:12:04 2001 +0100
@@ -310,6 +310,36 @@
     "Modified: / 12.8.1998 / 13:29:55 / cg"
 !
 
+testWrite1
+    "create a new file (initially not existing); write some data into it"
+
+    |h buffer nBytesWritten|
+
+    buffer := ExternalBytes new:10.
+    buffer replaceFrom:1 with:'1234567890'.
+
+    ('xxx1' asFilename exists) ifTrue:[
+        'xxx1' asFilename delete
+    ].
+
+    h := OperatingSystem createFileForReadWrite:'xxx1'.
+
+    nBytesWritten := h writeBytes:10 from:buffer startingAt:1.
+
+    h close.
+
+    self assert:('xxx1' asFilename fileSize == 10).
+    self assert:('xxx1' asFilename contentsOfEntireFile = '1234567890').
+
+    'xxx1' asFilename delete
+
+    "
+     self new testWrite1
+    "
+
+    "Modified: / 12.8.1998 / 13:29:55 / cg"
+!
+
 xtestFailCreate1
     "try to create an uncreatable new file (directory not existing)"