X Tutup
Skip to content

Commit ed57cb0

Browse files
author
Johan Brichau
committed
added tests for file reading
1 parent 6220802 commit ed57cb0

File tree

7 files changed

+21
-12
lines changed

7 files changed

+21
-12
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
tests
2+
testReadWriteToFileInFolderBinary
3+
| bytes |
4+
bytes := #(80 104 39 110 103 108 117 105 32 109 103 108 119 39 110 97 102 104 32 67 116 104 117 108 104 117 32 82 39 108 121 101 104 32 119 103 97 104 39 110 97 103 108 32 102 104 116 97 103 110) asByteArray.
5+
self
6+
writeToFile: bytes
7+
withFileNameDo:[:fileName | self assert: (bytes = (GRPlatform current contentsOfFile: fileName binary: true)) ]
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
tests
2+
testReadWriteToFileInFolderText
3+
| text |
4+
text := 'Ph''nglui mglw''nafh Cthulhu R''lyeh wgah''nagl fhtagn'.
5+
self
6+
writeToFile: text
7+
withFileNameDo:[:fileName | self assert: (text = (GRPlatform current contentsOfFile: fileName binary: false)) ]

repository/Grease-Tests-Pharo20-Core.package/GRPharoPlatformTest.class/instance/testWriteToFileInFolderBinary.st

Lines changed: 0 additions & 3 deletions
This file was deleted.

repository/Grease-Tests-Pharo20-Core.package/GRPharoPlatformTest.class/instance/testWriteToFileInFolderText.st

Lines changed: 0 additions & 3 deletions
This file was deleted.

repository/Grease-Tests-Pharo20-Core.package/GRPharoPlatformTest.class/instance/writeToFile..st renamed to repository/Grease-Tests-Pharo20-Core.package/GRPharoPlatformTest.class/instance/writeToFile.withFileNameDo..st

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
private
2-
writeToFile: aStringOrByteArray
2+
writeToFile: aStringOrByteArray withFileNameDo: aBlock
33
| fileName directory |
44
fileName := 'GRPharoPlatformTest'.
55
directory := FileSystem disk workingDirectory.
66
[ GRPlatform current
77
write: aStringOrByteArray
88
toFile: fileName
9-
inFolder: directory fullName
9+
inFolder: directory fullName.
10+
aBlock value: directory fullName,GRPlatform current pathSeparator,fileName
1011
] ensure: [
1112
(directory / fileName) delete ]

repository/Grease-Tests-Pharo20-Core.package/GRPharoPlatformTest.class/methodProperties.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
"testFullName" : "jf 10/6/2008 14:37",
88
"testGreaseIntegerOnCharacter" : "pmm 12/26/2010 21:44",
99
"testMessageSendValueWithPossibleArguments" : "jf 12/18/2009 12:29",
10-
"testWriteToFileInFolderBinary" : "pmm 1/22/2012 16:09",
11-
"testWriteToFileInFolderText" : "pmm 1/22/2012 15:54",
12-
"writeToFile:" : "pmm 8/4/2012 12:58" } }
10+
"testReadWriteToFileInFolderBinary" : "JohanBrichau 11/8/2014 10:34",
11+
"testReadWriteToFileInFolderText" : "JohanBrichau 11/8/2014 10:33",
12+
"writeToFile:withFileNameDo:" : "JohanBrichau 11/8/2014 10:33" } }

repository/Grease-Tests-Pharo20-Core.package/monticello.meta/version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
(name 'Grease-Tests-Pharo20-Core-pmm.11' message 'Issue 792: Issue encoding a non-ascii character preceded by an xml-unsafe one- https://code.google.com/p/seaside/issues/detail?id=792' id '3247b811-bdef-473a-aa2d-473a532ec629' date '21 May 2014' time '9:32:12.009306 pm' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-JohanBrichau.10' message 'Issue 789: Running WAFilelibraryTest on Pharo3 leaves Seaside-Tests-Core package in a dirty state https://code.google.com/p/seaside/issues/detail?id=789' id 'e3e4c2eb-cef7-4168-aeae-7a57490aa2b1' date '19 April 2014' time '5:31:18.877112 pm' author 'JohanBrichau' ancestors ((name 'Grease-Tests-Pharo20-Core-JohanBrichau.9' message 'move GRCountingStream from Pharo-only package to Core' id 'b89fed14-cf86-4d07-829c-cbdcea6da4f4' date '16 February 2014' time '9:30:04.97327 pm' author 'JohanBrichau' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.8' message 'Issue 770: ScaledDecimal rendering supporthttp://code.google.com/p/seaside/issues/detail?id=770' id '6e6bd71a-439c-4902-a68d-e1af63451f40' date '15 September 2013' time '12:28:07.009 pm' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.7' message '- bring #doSilently: back' id '906ba423-0a76-410e-8e76-1f9df06cf8cc' date '12 September 2013' time '6:04:53.713 pm' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.6' message '- fix URLs' id 'ff0b9dc6-d275-4f59-8a5b-a01e9cff4ec6' date '12 September 2013' time '4:01:56.23633 pm' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.5' message '- fix compilation' id 'd299e09d-7488-4996-801a-ba125ebef913' date '12 September 2013' time '11:26:02.540867 am' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-JohanBrichau.4' message 'GRUtf8CodecTest.testCodecUtf8ShortestForm is an expected failure' id '8f5f9382-81d9-41d4-92b7-69628deaab25' date '22 August 2013' time '8:00:55.046 pm' author 'JohanBrichau' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.3' message '- ???' id 'e4ea84af-efd3-48cb-83b5-cacb0a234bf7' date '19 August 2012' time '10:13:51.278 am' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.2' message '- change package name' id 'fadba33c-472e-4ea1-a210-fc25fee25c8e' date '4 August 2012' time '1:10:10.314 pm' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.1' message '- bump' id '4feb168a-ce43-4b92-bdf2-d83c8c5d2405' date '4 August 2012' time '1:06:42.944 pm' author 'pmm' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())
1+
(name 'Grease-Tests-Pharo20-Core-JohanBrichau.12' message 'Added tests for file reading' id '6b2eb7ec-5ea0-4109-b85f-940c6156b6d4' date '8 November 2014' time '10:39:38.553637 am' author 'JohanBrichau' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.11' message 'Issue 792: Issue encoding a non-ascii character preceded by an xml-unsafe one- https://code.google.com/p/seaside/issues/detail?id=792' id '3247b811-bdef-473a-aa2d-473a532ec629' date '21 May 2014' time '9:32:12.009306 pm' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-JohanBrichau.10' message 'Issue 789: Running WAFilelibraryTest on Pharo3 leaves Seaside-Tests-Core package in a dirty state https://code.google.com/p/seaside/issues/detail?id=789' id 'e3e4c2eb-cef7-4168-aeae-7a57490aa2b1' date '19 April 2014' time '5:31:18.877112 pm' author 'JohanBrichau' ancestors ((name 'Grease-Tests-Pharo20-Core-JohanBrichau.9' message 'move GRCountingStream from Pharo-only package to Core' id 'b89fed14-cf86-4d07-829c-cbdcea6da4f4' date '16 February 2014' time '9:30:04.97327 pm' author 'JohanBrichau' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.8' message 'Issue 770: ScaledDecimal rendering supporthttp://code.google.com/p/seaside/issues/detail?id=770' id '6e6bd71a-439c-4902-a68d-e1af63451f40' date '15 September 2013' time '12:28:07.009 pm' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.7' message '- bring #doSilently: back' id '906ba423-0a76-410e-8e76-1f9df06cf8cc' date '12 September 2013' time '6:04:53.713 pm' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.6' message '- fix URLs' id 'ff0b9dc6-d275-4f59-8a5b-a01e9cff4ec6' date '12 September 2013' time '4:01:56.23633 pm' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.5' message '- fix compilation' id 'd299e09d-7488-4996-801a-ba125ebef913' date '12 September 2013' time '11:26:02.540867 am' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-JohanBrichau.4' message 'GRUtf8CodecTest.testCodecUtf8ShortestForm is an expected failure' id '8f5f9382-81d9-41d4-92b7-69628deaab25' date '22 August 2013' time '8:00:55.046 pm' author 'JohanBrichau' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.3' message '- ???' id 'e4ea84af-efd3-48cb-83b5-cacb0a234bf7' date '19 August 2012' time '10:13:51.278 am' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.2' message '- change package name' id 'fadba33c-472e-4ea1-a210-fc25fee25c8e' date '4 August 2012' time '1:10:10.314 pm' author 'pmm' ancestors ((name 'Grease-Tests-Pharo20-Core-pmm.1' message '- bump' id '4feb168a-ce43-4b92-bdf2-d83c8c5d2405' date '4 August 2012' time '1:06:42.944 pm' author 'pmm' ancestors () stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())) stepChildren ())

0 commit comments

Comments
 (0)
X Tutup