]> gitweb.factorcode.org Git - factor.git/blob - extra/mason/child/child-tests.factor
Solution to Project Euler problem 65
[factor.git] / extra / mason / child / child-tests.factor
1 IN: mason.child.tests
2 USING: mason.child mason.config tools.test namespaces io kernel sequences ;
3
4 [ { "make" "winnt-x86-32" } ] [
5     [
6         "winnt" target-os set
7         "x86.32" target-cpu set
8         make-cmd
9     ] with-scope
10 ] unit-test
11
12 [ { "make" "macosx-x86-32" } ] [
13     [
14         "macosx" target-os set
15         "x86.32" target-cpu set
16         make-cmd
17     ] with-scope
18 ] unit-test
19
20 [ { "gmake" "netbsd-ppc" } ] [
21     [
22         "netbsd" target-os set
23         "ppc" target-cpu set
24         make-cmd
25     ] with-scope
26 ] unit-test
27
28 [ { "./factor" "-i=boot.macosx-ppc.image" "-no-user-init" } ] [
29     [
30         "macosx" target-os set
31         "ppc" target-cpu set
32         boot-cmd
33     ] with-scope
34 ] unit-test
35
36 [ { "./factor.com" "-i=boot.x86.32.image" "-no-user-init" "-sse-version=30" } ] [
37     [
38         "winnt" target-os set
39         "x86.32" target-cpu set
40         boot-cmd
41     ] with-scope
42 ] unit-test
43
44 [ [ "Hi" print ] [ drop 3 ] [ 4 ] recover-else ] must-infer
45
46 [ 4 ] [ [ "Hi" print ] [ drop 3 ] [ 4 ] recover-else ] unit-test
47
48 [ 3 ] [ [ "Hi" throw ] [ drop 3 ] [ 4 ] recover-else ] unit-test
49
50 [ "A" ] [
51     {
52         { [ 3 throw ] [ { "X" "Y" "Z" "A" } nth ] }
53         [ "B" ]
54     } recover-cond
55 ] unit-test
56
57 [ "B" ] [
58     {
59         { [ ] [ ] }
60         [ "B" ]
61     } recover-cond
62 ] unit-test