]> gitweb.factorcode.org Git - factor.git/blob - basis/vocabs/prettyprint/prettyprint-tests.factor
5c81f373d8931f7b1bd82e9f082c8b43070e468b
[factor.git] / basis / vocabs / prettyprint / prettyprint-tests.factor
1 USING: vocabs.prettyprint vocabs.prettyprint.private tools.test
2 io.streams.string eval ;
3 IN: vocabs.prettyprint.tests
4
5 : manifest-test-1 ( -- string )
6     """USING: kernel namespaces vocabs.parser vocabs.prettyprint ;
7
8     << manifest get pprint-manifest >>""" ;
9
10 [
11 """USING: kernel namespaces vocabs.parser vocabs.prettyprint ;"""
12 ]
13 [ [ manifest-test-1 eval( -- ) ] with-string-writer ] unit-test
14
15 : manifest-test-2 ( -- string )
16     """USING: kernel namespaces vocabs.parser vocabs.prettyprint ;
17     IN: vocabs.prettyprint.tests
18
19     << manifest get pprint-manifest >>""" ;
20
21 [
22 """USING: kernel namespaces vocabs.parser vocabs.prettyprint ;
23 IN: vocabs.prettyprint.tests"""
24 ]
25 [ [ manifest-test-2 eval( -- ) ] with-string-writer ] unit-test
26
27 : manifest-test-3 ( -- string )
28     """USING: kernel namespaces vocabs.parser vocabs.prettyprint ;
29     FROM: math => + - ;
30     QUALIFIED: system
31     QUALIFIED-WITH: assocs a
32     EXCLUDE: parser => run-file ;
33     IN: vocabs.prettyprint.tests
34
35     << manifest get pprint-manifest >>""" ;
36
37 [
38 """USING: kernel namespaces vocabs.parser vocabs.prettyprint ;
39 FROM: math => + - ;
40 QUALIFIED: system
41 QUALIFIED-WITH: assocs a
42 EXCLUDE: parser => run-file ;
43 IN: vocabs.prettyprint.tests"""
44 ]
45 [ [ manifest-test-3 eval( -- ) ] with-string-writer ] unit-test
46
47 [
48 """USING: alien.c-types alien.syntax byte-arrays io
49 io.encodings.binary io.encodings.string io.encodings.utf8
50 io.streams.byte-array kernel sequences system system-info unix ;"""
51 ] [
52     [
53         {
54             "alien.c-types"
55             "alien.syntax"
56             "byte-arrays"
57             "io"
58             "io.encodings.binary"
59             "io.encodings.string"
60             "io.encodings.utf8"
61             "io.streams.byte-array"
62             "kernel"
63             "sequences"
64             "system"
65             "system-info"
66             "unix"
67         } pprint-using
68     ] with-string-writer
69 ] unit-test