]> gitweb.factorcode.org Git - factor.git/blob - basis/vocabs/prettyprint/prettyprint-tests.factor
Solution to Project Euler problem 65
[factor.git] / basis / vocabs / prettyprint / prettyprint-tests.factor
1 IN: vocabs.prettyprint.tests
2 USING: vocabs.prettyprint tools.test io.streams.string multiline eval ;
3
4 : manifest-test-1 ( -- string )
5     <" USING: kernel namespaces vocabs.parser vocabs.prettyprint ;
6
7     << manifest get pprint-manifest >> "> ;
8
9 [
10 <" USING: kernel namespaces vocabs.parser vocabs.prettyprint ;">
11 ]
12 [ [ manifest-test-1 eval( -- ) ] with-string-writer ] unit-test
13
14 : manifest-test-2 ( -- string )
15     <" USING: kernel namespaces vocabs.parser vocabs.prettyprint ;
16     IN: vocabs.prettyprint.tests
17
18     << manifest get pprint-manifest >> "> ;
19
20 [
21 <" USING: kernel namespaces vocabs.parser vocabs.prettyprint ;
22 IN: vocabs.prettyprint.tests">
23 ]
24 [ [ manifest-test-2 eval( -- ) ] with-string-writer ] unit-test
25
26 : manifest-test-3 ( -- string )
27     <" USING: kernel namespaces vocabs.parser vocabs.prettyprint ;
28     FROM: math => + - ;
29     QUALIFIED: system
30     QUALIFIED-WITH: assocs a
31     EXCLUDE: parser => run-file ;
32     IN: vocabs.prettyprint.tests
33
34     << manifest get pprint-manifest >> "> ;
35
36 [
37 <" USING: kernel namespaces vocabs.parser vocabs.prettyprint ;
38 FROM: math => + - ;
39 QUALIFIED: system
40 QUALIFIED-WITH: assocs a
41 EXCLUDE: parser => run-file ;
42 IN: vocabs.prettyprint.tests">
43 ]
44 [ [ manifest-test-3 eval( -- ) ] with-string-writer ] unit-test