-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test unique name of two generated temporary files
- Loading branch information
Showing
2 changed files
with
14 additions
and
7 deletions.
There are no files selected for viewing
19 changes: 13 additions & 6 deletions
19
repository/Grease-Tests-Core.package/GRPlatformTest.class/instance/testNewTemporaryFile.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,20 @@ | ||
tests-files | ||
testNewTemporaryFile | ||
|
||
| temporaryFile | | ||
| temporaryFile1 temporaryFile2 | | ||
[ | ||
temporaryFile := GRPlatform current newTemporaryFile. | ||
temporaryFile1 := GRPlatform current newTemporaryFile. | ||
temporaryFile2 := GRPlatform current newTemporaryFile. | ||
GRPlatform current | ||
writeFileStreamOn: temporaryFile | ||
writeFileStreamOn: temporaryFile1 | ||
do: [ :str | str nextPutAll: 'test temporary' ] | ||
binary: false. | ||
self assert: (GRPlatform current fileExists: temporaryFile) | ||
] ensure: [ GRPlatform current deleteFile: temporaryFile ]. | ||
self deny: (GRPlatform current fileExists: temporaryFile) | ||
GRPlatform current | ||
writeFileStreamOn: temporaryFile2 | ||
do: [ :str | str nextPutAll: #[116 101 115 116 32 116 101 109 112 111 114 97 114 121] ] | ||
binary: true. | ||
self assert: (GRPlatform current fileExists: temporaryFile1). | ||
self deny: (GRPlatform current localNameOf: temporaryFile1) equals: (GRPlatform current localNameOf: temporaryFile2) | ||
] ensure: [ GRPlatform current deleteFile: temporaryFile1. GRPlatform current deleteFile: temporaryFile2 ]. | ||
self deny: (GRPlatform current fileExists: temporaryFile1). | ||
self deny: (GRPlatform current fileExists: temporaryFile2) |
2 changes: 1 addition & 1 deletion
2
repository/Grease-Tests-Core.package/monticello.meta/categories.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
SystemOrganization addCategory: #'Grease-Tests-Core'! | ||
self packageOrganizer ensurePackage: #'Grease-Tests-Core' withTags: #()! |