Passing the wrong type of sequence to M\ encoder write now throws an error
parent
ec72f33fcb
commit
0f26d02d41
|
@ -5,7 +5,7 @@ IN: io.files.unique.tests
|
||||||
|
|
||||||
[ 123 ] [
|
[ 123 ] [
|
||||||
"core" ".test" [
|
"core" ".test" [
|
||||||
[ [ 123 CHAR: a <repetition> ] dip ascii set-file-contents ]
|
[ [ 123 CHAR: a <string> ] dip ascii set-file-contents ]
|
||||||
[ file-info size>> ] bi
|
[ file-info size>> ] bi
|
||||||
] cleanup-unique-file
|
] cleanup-unique-file
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
|
@ -130,7 +130,9 @@ M: encoder stream-element-type
|
||||||
M: encoder stream-write1
|
M: encoder stream-write1
|
||||||
>encoder< encode-char ;
|
>encoder< encode-char ;
|
||||||
|
|
||||||
: encoder-write ( string stream encoding -- )
|
GENERIC# encoder-write 2 ( string stream encoding -- )
|
||||||
|
|
||||||
|
M: string encoder-write
|
||||||
[ encode-char ] 2curry each ;
|
[ encode-char ] 2curry each ;
|
||||||
|
|
||||||
M: encoder stream-write
|
M: encoder stream-write
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
USING: arrays debugger.threads destructors io io.directories
|
USING: arrays debugger.threads destructors io io.directories
|
||||||
io.encodings.8-bit io.encodings.ascii io.encodings.binary
|
io.encodings.8-bit io.encodings.ascii io.encodings.binary
|
||||||
io.files io.files.private io.files.temp io.files.unique kernel
|
io.files io.files.private io.files.temp io.files.unique kernel
|
||||||
make math sequences system threads tools.test ;
|
make math sequences system threads tools.test generic.standard ;
|
||||||
IN: io.files.tests
|
IN: io.files.tests
|
||||||
|
|
||||||
\ exists? must-infer
|
\ exists? must-infer
|
||||||
|
@ -144,3 +144,15 @@ USE: debugger.threads
|
||||||
-10 seek-absolute seek-input
|
-10 seek-absolute seek-input
|
||||||
] with-file-reader
|
] with-file-reader
|
||||||
] must-fail
|
] must-fail
|
||||||
|
|
||||||
|
[
|
||||||
|
"non-string-error" unique-file ascii [
|
||||||
|
{ } write
|
||||||
|
] with-file-writer
|
||||||
|
] [ no-method? ] must-fail-with
|
||||||
|
|
||||||
|
[
|
||||||
|
"non-byte-array-error" unique-file binary [
|
||||||
|
"" write
|
||||||
|
] with-file-writer
|
||||||
|
] [ no-method? ] must-fail-with
|
Loading…
Reference in New Issue