factor/extra/mason/child/child-tests.factor

47 lines
1.1 KiB
Factor
Raw Normal View History

USING: io io.pathnames kernel mason.child mason.config
namespaces sequences system tools.test ;
2008-09-16 00:20:33 -04:00
IN: mason.child.tests
{ { "make" "macosx-x86-32" } } [
2012-07-19 18:11:33 -04:00
H{
{ target-os macosx }
{ target-cpu x86.32 }
} [ mason-child-make-cmd ] with-variables
2008-09-16 00:20:33 -04:00
] unit-test
! Must be an absolute path on Windows because launch directory
! is relative to parent directory (instead of current directory).
2015-08-05 14:24:35 -04:00
{ t } [
H{
{ target-os windows }
{ target-cpu x86.32 }
} [ mason-child-make-cmd ] with-variables first absolute-path?
] unit-test
2015-06-10 22:56:11 -04:00
{ t } [
H{
{ target-os windows }
{ target-cpu x86.32 }
} [ mason-child-boot-cmd ] with-variables first absolute-path?
] unit-test
[ [ "Hi" print ] [ drop 3 ] [ 4 ] recover-else ] must-infer
{ 4 } [ [ "Hi" print ] [ drop 3 ] [ 4 ] recover-else ] unit-test
{ 3 } [ [ "Hi" throw ] [ drop 3 ] [ 4 ] recover-else ] unit-test
{ "A" } [
{
{ [ 3 throw ] [ { "X" "Y" "Z" "A" } nth ] }
[ "B" ]
} recover-cond
] unit-test
{ "B" } [
{
{ [ ] [ ] }
[ "B" ]
} recover-cond
] unit-test