X Tutup
Skip to content

Commit f20c01f

Browse files
author
Johan Brichau
committed
Test unique name of two generated temporary files
1 parent f7d355f commit f20c01f

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed
Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
tests-files
22
testNewTemporaryFile
33

4-
| temporaryFile |
4+
| temporaryFile1 temporaryFile2 |
55
[
6-
temporaryFile := GRPlatform current newTemporaryFile.
6+
temporaryFile1 := GRPlatform current newTemporaryFile.
7+
temporaryFile2 := GRPlatform current newTemporaryFile.
78
GRPlatform current
8-
writeFileStreamOn: temporaryFile
9+
writeFileStreamOn: temporaryFile1
910
do: [ :str | str nextPutAll: 'test temporary' ]
1011
binary: false.
11-
self assert: (GRPlatform current fileExists: temporaryFile)
12-
] ensure: [ GRPlatform current deleteFile: temporaryFile ].
13-
self deny: (GRPlatform current fileExists: temporaryFile)
12+
GRPlatform current
13+
writeFileStreamOn: temporaryFile2
14+
do: [ :str | str nextPutAll: #[116 101 115 116 32 116 101 109 112 111 114 97 114 121] ]
15+
binary: true.
16+
self assert: (GRPlatform current fileExists: temporaryFile1).
17+
self deny: (GRPlatform current localNameOf: temporaryFile1) equals: (GRPlatform current localNameOf: temporaryFile2)
18+
] ensure: [ GRPlatform current deleteFile: temporaryFile1. GRPlatform current deleteFile: temporaryFile2 ].
19+
self deny: (GRPlatform current fileExists: temporaryFile1).
20+
self deny: (GRPlatform current fileExists: temporaryFile2)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
SystemOrganization addCategory: #'Grease-Tests-Core'!
1+
self packageOrganizer ensurePackage: #'Grease-Tests-Core' withTags: #()!

0 commit comments

Comments
 (0)
X Tutup