Merge branch 'master' of git://factorcode.org/git/factor
commit
bd04fa9a59
|
@ -0,0 +1,4 @@
|
||||||
|
IN: io.backend.windows.privileges.tests
|
||||||
|
USING: io.backend.windows.privileges tools.test ;
|
||||||
|
|
||||||
|
[ [ ] with-privileges ] must-infer
|
|
@ -1,12 +1,13 @@
|
||||||
USING: io.backend kernel continuations sequences
|
USING: io.backend kernel continuations sequences
|
||||||
system vocabs.loader combinators ;
|
system vocabs.loader combinators fry ;
|
||||||
IN: io.backend.windows.privileges
|
IN: io.backend.windows.privileges
|
||||||
|
|
||||||
HOOK: set-privilege io-backend ( name ? -- ) inline
|
HOOK: set-privilege io-backend ( name ? -- )
|
||||||
|
|
||||||
: with-privileges ( seq quot -- )
|
: with-privileges ( seq quot -- )
|
||||||
over [ [ t set-privilege ] each ] curry compose
|
[ '[ _ [ t set-privilege ] each @ ] ]
|
||||||
swap [ [ f set-privilege ] each ] curry [ ] cleanup ; inline
|
[ drop '[ _ [ f set-privilege ] each ] ]
|
||||||
|
2bi [ ] cleanup ; inline
|
||||||
|
|
||||||
{
|
{
|
||||||
{ [ os winnt? ] [ "io.backend.windows.nt.privileges" require ] }
|
{ [ os winnt? ] [ "io.backend.windows.nt.privileges" require ] }
|
||||||
|
|
|
@ -42,7 +42,7 @@ IN: io.launcher.windows.nt.tests
|
||||||
console-vm "-run=listener" 2array >>command
|
console-vm "-run=listener" 2array >>command
|
||||||
+closed+ >>stdin
|
+closed+ >>stdin
|
||||||
+stdout+ >>stderr
|
+stdout+ >>stderr
|
||||||
ascii [ input-stream get contents ] with-process-reader
|
ascii [ contents ] with-process-reader
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
: launcher-test-path ( -- str )
|
: launcher-test-path ( -- str )
|
||||||
|
@ -85,7 +85,7 @@ IN: io.launcher.windows.nt.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> lines first
|
ascii <process-reader> stream-lines first
|
||||||
] with-directory
|
] with-directory
|
||||||
] unit-test
|
] unit-test
|
||||||
|
|
||||||
|
@ -97,7 +97,7 @@ IN: io.launcher.windows.nt.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> contents
|
ascii <process-reader> stream-contents
|
||||||
] with-directory eval( -- alist )
|
] with-directory eval( -- alist )
|
||||||
|
|
||||||
os-envs =
|
os-envs =
|
||||||
|
@ -109,7 +109,7 @@ IN: io.launcher.windows.nt.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> contents
|
ascii <process-reader> stream-contents
|
||||||
] with-directory eval( -- alist )
|
] with-directory eval( -- alist )
|
||||||
|
|
||||||
os-envs =
|
os-envs =
|
||||||
|
@ -120,7 +120,7 @@ IN: io.launcher.windows.nt.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> contents
|
ascii <process-reader> stream-contents
|
||||||
] with-directory eval( -- alist )
|
] with-directory eval( -- alist )
|
||||||
|
|
||||||
"A" swap at
|
"A" swap at
|
||||||
|
@ -132,7 +132,7 @@ IN: io.launcher.windows.nt.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> contents
|
ascii <process-reader> stream-contents
|
||||||
] with-directory eval( -- alist )
|
] with-directory eval( -- alist )
|
||||||
|
|
||||||
"USERPROFILE" swap at "XXX" =
|
"USERPROFILE" swap at "XXX" =
|
||||||
|
|
Loading…
Reference in New Issue