-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change ZnRingBuffer>>writeAllOn: to an implementation that works for …
…a -ring- (duh) and rename it to nextPutAllOn:
- Loading branch information
Showing
7 changed files
with
35 additions
and
24 deletions.
There are no files selected for viewing
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
4 changes: 4 additions & 0 deletions
4
repository/Seaside-Zinc-Core.package/ZnRingBuffer.class/instance/nextPutAllOn..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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
private | ||
nextPutAllOn: aStream | ||
|
||
self do: [ :element | aStream nextPut: element ] |
4 changes: 0 additions & 4 deletions
4
repository/Seaside-Zinc-Core.package/ZnRingBuffer.class/instance/writeAllOn..st
This file was deleted.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
repository/Seaside-Zinc-Core.package/ZnRingBuffer.class/properties.json
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
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
28 changes: 28 additions & 0 deletions
28
repository/Seaside-Zinc-Tests.package/ZnRingBufferTest.class/instance/testNextPutAllOn.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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
tests | ||
testNextPutAllOn | ||
|
||
| buffer temporaryFile | | ||
buffer := GRPlatform current ringBufferClass on: (ByteArray new: 4). | ||
buffer | ||
at: 1 put: 128; | ||
at: 2 put: 129; | ||
at: 3 put: 130; | ||
at: 4 put: 131. | ||
temporaryFile := GRPlatform current newTemporaryFile. | ||
[ | ||
GRPlatform current | ||
writeFileStreamOn: temporaryFile | ||
do: [ :strm | buffer nextPutAllOn: strm ] | ||
binary: true. | ||
self assert: (GRPlatform current contentsOfFile: temporaryFile binary: true) equals: #[128 129 130 131] | ||
] ensure: [ GRPlatform current deleteFile: temporaryFile ]. | ||
|
||
buffer moveStartTo: 3. | ||
temporaryFile := GRPlatform current newTemporaryFile. | ||
[ | ||
GRPlatform current | ||
writeFileStreamOn: temporaryFile | ||
do: [ :strm | buffer nextPutAllOn: strm ] | ||
binary: true. | ||
self assert: (GRPlatform current contentsOfFile: temporaryFile binary: true) equals: #[130 131 128 129] | ||
] ensure: [ GRPlatform current deleteFile: temporaryFile ]. |
16 changes: 0 additions & 16 deletions
16
repository/Seaside-Zinc-Tests.package/ZnRingBufferTest.class/instance/testWriteAllOn.st
This file was deleted.
Oops, something went wrong.