Skip to content
Permalink
Browse files

21368 additional descriptions for FileSystemTest>>testFileNames

  • Loading branch information
akgrant committed Jul 10, 2018
1 parent 29c181f commit 37e4f735d287fce537b9656da01c03cd9be9d728
Showing with 12 additions and 4 deletions.
  1. +12 −4 src/FileSystem-Tests-Core/FileSystemTest.class.st
@@ -458,17 +458,25 @@ FileSystemTest >> testFile [

{ #category : #tests }
FileSystemTest >> testFileNames [
"Ensure that file name character encoding works properly"
| reference |
#('test one' 'test with two' 'test-äöü' 'test.äöü') do: [ :each |
reference := filesystem workingDirectory / each.
self assert: reference basename = each.
self deny: reference exists.
"Enclose assertion failure text in blocks so that the string manipulation
only occurs on failure (which should be uncommon).
Convert the strings to byte arrays so that the encoding can be easily seen."
self assert: reference basename = each
description: [ 'basename ', reference basename asByteArray printString, ' ~= ', each asByteArray printString ].
self deny: reference exists
description: [ reference basename, ' exists but should not' ].
reference
writeStreamDo: [ :stream | stream nextPutAll: 'gooly' ]
ifPresent: [ self fail ].
[ self assert: reference exists.
[ self assert: reference exists
description: [ reference basename, ' should exist but does not' ].
self assert: (filesystem workingDirectory children
anySatisfy: [ :ref | ref = reference ]) ]
anySatisfy: [ :ref | ref = reference ])
description: [ 'children did not find ', reference basename ] ]
ensure: [ reference delete ] ]
]

0 comments on commit 37e4f73

Please sign in to comment.
You can’t perform that action at this time.