]> gitweb.factorcode.org Git - factor.git/blob - core/io/streams/memory/memory-tests.factor
Update some copyright headers to follow the current convention
[factor.git] / core / io / streams / memory / memory-tests.factor
1 ! Copyright (C) 2011 Joe Groff.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: alien.data destructors io io.streams.memory kernel libc
4 tools.test ;
5 IN: io.streams.memory.tests
6
7 { 1 2 3 } [
8     B{ 1 2 3 } <memory-stream>
9     [ stream-read1 ] [ stream-read1 ] [ stream-read1 ] tri
10 ] unit-test
11
12 { 1 2 3 } [
13     [
14         B{ 1 2 3 } malloc-byte-array &free <memory-stream>
15         [ stream-read1 ] [ stream-read1 ] [ stream-read1 ] tri
16     ] with-destructors
17 ] unit-test
18
19 { B{ 1 2 3 } B{ 4 5 6 7 8 } } [
20     B{ 1 2 3 4 5 6 7 8 } <memory-stream>
21     [ 3 swap stream-read ] [ 5 swap stream-read ] bi
22 ] unit-test
23
24 { B{ 1 2 3 } B{ 4 5 6 7 8 } } [
25     [
26         B{ 1 2 3 4 5 6 7 8 } malloc-byte-array &free <memory-stream>
27         [ 3 swap stream-read ] [ 5 swap stream-read ] bi
28     ] with-destructors
29 ] unit-test