Skip to content

Commit

Permalink
added test for ZnRingBuffer>>writeAllOn:
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Brichau committed Mar 17, 2024
1 parent 166a98c commit 27c8905
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
tests
testWriteAllOn

| buffer temporaryFile |
buffer := GRPlatform current ringBufferClass on: (ByteArray new: 2).
buffer
at: 1 put: 128;
at: 2 put: 129.
temporaryFile := GRPlatform current newTemporaryFile.
[
GRPlatform current
writeFileStreamOn: temporaryFile
do: [ :strm | buffer writeAllOn: strm ]
binary: true.
self assert: (GRPlatform current contentsOfFile: temporaryFile binary: true) equals: #[128 129]
] ensure: [ GRPlatform current deleteFile: temporaryFile ]

0 comments on commit 27c8905

Please sign in to comment.