io.launcher.windows.tests: many of the tests can result in utf8-encoded strings

db4
Björn Lindqvist 2014-06-10 14:59:07 +02:00 committed by John Benediktsson
parent b40f2ff544
commit a4e98529fa
2 changed files with 12 additions and 11 deletions

View File

@ -1,2 +1,3 @@
USE: io USE: io
"Hello appender" print "Hello appender" print
"Örjan ågren är åter" print

View File

@ -1,6 +1,6 @@
USING: accessors arrays assocs calendar continuations USING: accessors arrays assocs calendar continuations
environment eval hashtables io io.directories environment eval hashtables io io.directories
io.encodings.ascii io.files io.files.temp io.launcher io.encodings.ascii io.encodings.utf8 io.files io.files.temp io.launcher
io.launcher.windows io.pathnames kernel math namespaces parser io.launcher.windows io.pathnames kernel math namespaces parser
sequences splitting system tools.test combinators.short-circuit ; sequences splitting system tools.test combinators.short-circuit ;
IN: io.launcher.windows.tests IN: io.launcher.windows.tests
@ -92,7 +92,7 @@ IN: io.launcher.windows.tests
console-vm "-run=listener" 2array >>command console-vm "-run=listener" 2array >>command
+closed+ >>stdin +closed+ >>stdin
+stdout+ >>stderr +stdout+ >>stderr
ascii [ lines last ] with-process-reader utf8 [ lines last ] with-process-reader
] unit-test ] unit-test
: launcher-test-path ( -- str ) : launcher-test-path ( -- str )
@ -135,7 +135,7 @@ IN: io.launcher.windows.tests
<process> <process>
console-vm "-script" "stderr.factor" 3array >>command console-vm "-script" "stderr.factor" 3array >>command
"err2.txt" temp-file >>stderr "err2.txt" temp-file >>stderr
ascii <process-reader> stream-lines first utf8 <process-reader> stream-lines first
] with-directory ] with-directory
] unit-test ] unit-test
@ -147,7 +147,7 @@ IN: io.launcher.windows.tests
launcher-test-path [ launcher-test-path [
<process> <process>
console-vm "-script" "env.factor" 3array >>command console-vm "-script" "env.factor" 3array >>command
ascii <process-reader> stream-contents utf8 <process-reader> stream-contents
] with-directory eval( -- alist ) ] with-directory eval( -- alist )
os-envs = os-envs =
@ -159,9 +159,9 @@ IN: io.launcher.windows.tests
console-vm "-script" "env.factor" 3array >>command console-vm "-script" "env.factor" 3array >>command
+replace-environment+ >>environment-mode +replace-environment+ >>environment-mode
os-envs >>environment os-envs >>environment
ascii <process-reader> stream-contents utf8 <process-reader> stream-contents
] with-directory eval( -- alist ) ] with-directory eval( -- alist )
os-envs = os-envs =
] unit-test ] unit-test
@ -170,7 +170,7 @@ IN: io.launcher.windows.tests
<process> <process>
console-vm "-script" "env.factor" 3array >>command console-vm "-script" "env.factor" 3array >>command
{ { "A" "B" } } >>environment { { "A" "B" } } >>environment
ascii <process-reader> stream-contents utf8 <process-reader> stream-contents
] with-directory eval( -- alist ) ] with-directory eval( -- alist )
"A" of "A" of
@ -182,7 +182,7 @@ IN: io.launcher.windows.tests
console-vm "-script" "env.factor" 3array >>command console-vm "-script" "env.factor" 3array >>command
{ { "USERPROFILE" "XXX" } } >>environment { { "USERPROFILE" "XXX" } } >>environment
+prepend-environment+ >>environment-mode +prepend-environment+ >>environment-mode
ascii <process-reader> stream-contents utf8 <process-reader> stream-contents
] with-directory eval( -- alist ) ] with-directory eval( -- alist )
"USERPROFILE" of "XXX" = "USERPROFILE" of "XXX" =
@ -201,7 +201,7 @@ IN: io.launcher.windows.tests
[ "append-test" temp-file delete-file ] ignore-errors [ "append-test" temp-file delete-file ] ignore-errors
[ "Hello appender\r\nHello appender\r\n" ] [ { "Hello appender\r\nÖrjan ågren är åter\r\nHello appender\r\nÖrjan ågren är åter\r\n" } [
2 [ 2 [
launcher-test-path [ launcher-test-path [
<process> <process>
@ -210,8 +210,8 @@ IN: io.launcher.windows.tests
try-process try-process
] with-directory ] with-directory
] times ] times
"append-test" temp-file ascii file-contents "append-test" temp-file utf8 file-contents
] unit-test ] unit-test
[ "IN: scratchpad " ] [ [ "IN: scratchpad " ] [