X Tutup
Skip to content

Commit d305fd5

Browse files
author
Johan Brichau
committed
Move utf8 test file read/write test to Pharo specific test package and mark it as expected failure for Pharo 7 (and earlier)
1 parent 652acb5 commit d305fd5

File tree

3 files changed

+23
-5
lines changed

3 files changed

+23
-5
lines changed
Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
tests-filestreams
22
testReadWriteToFileInFolderText
3-
#('Ph''nglui mglw''nafh Cthulhu R''lyeh wgah''nagl fhtagn' 'Übèrstrîñgé') do:[ :text |
4-
self
5-
writeToFile: text
6-
withFileNameDo:[ :fileName |
7-
self assert: text equals: (GRPlatform current contentsOfFile: fileName binary: false) ] ].
3+
| text |
4+
text := 'Ph''nglui mglw''nafh Cthulhu R''lyeh wgah''nagl fhtagn'.
5+
self
6+
writeToFile: text
7+
withFileNameDo:[ :fileName |
8+
self assert: (text = (GRPlatform current contentsOfFile: fileName binary: false)) ]
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
running
2+
expectedFailures
3+
"UTF8 encoding/decoding for text files only available from Pharo7"
4+
Smalltalk at: #SystemVersion ifPresent: [ :systemVersion |
5+
| versionString |
6+
versionString := systemVersion current version.
7+
(versionString beginsWith: 'Pharo') ifTrue: [
8+
systemVersion current major <= 7
9+
ifTrue: [ ^ #(testReadWriteToFileInFolderTextUTF8) ] ] ].
10+
^ #()
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
tests-filestreams
2+
testReadWriteToFileInFolderTextUTF8
3+
#('Übèrstrîñgé' '£ęλ~') do:[ :text |
4+
self
5+
writeToFile: text
6+
withFileNameDo:[ :fileName |
7+
self assert: text equals: (GRPlatform current contentsOfFile: fileName binary: false) ] ].

0 commit comments

Comments
 (0)
X Tutup