]> gitweb.factorcode.org Git - factor.git/blob - extra/mason/child/child-tests.factor
33bc346541095c9591aeb40b86bafda73242b55a
[factor.git] / extra / mason / child / child-tests.factor
1 USING: io io.pathnames kernel mason.child mason.config
2 namespaces sequences system tools.test ;
3 IN: mason.child.tests
4
5 [ { "nmake" "/f" "nmakefile" "x86-32" } ] [
6     H{
7         { target-os windows }
8         { target-cpu x86.32 }
9     } [ mason-child-make-cmd ] with-variables
10 ] unit-test
11
12 [ { "make" "macosx-x86-32" } ] [
13     H{
14         { target-os macosx }
15         { target-cpu x86.32 }
16     } [ mason-child-make-cmd ] with-variables
17 ] unit-test
18
19 ! Must be an absolute path on Windows because launch directory
20 ! is relative to parent directory (instead of current directory).
21 { t } [
22     H{
23         { target-os windows }
24         { target-cpu x86.32 }
25     } [ mason-child-boot-cmd ] with-variables first absolute-path?
26 ] unit-test
27
28 [ [ "Hi" print ] [ drop 3 ] [ 4 ] recover-else ] must-infer
29
30 [ 4 ] [ [ "Hi" print ] [ drop 3 ] [ 4 ] recover-else ] unit-test
31
32 [ 3 ] [ [ "Hi" throw ] [ drop 3 ] [ 4 ] recover-else ] unit-test
33
34 [ "A" ] [
35     {
36         { [ 3 throw ] [ { "X" "Y" "Z" "A" } nth ] }
37         [ "B" ]
38     } recover-cond
39 ] unit-test
40
41 [ "B" ] [
42     {
43         { [ ] [ ] }
44         [ "B" ]
45     } recover-cond
46 ] unit-test