]> gitweb.factorcode.org Git - factor.git/blob - basis/json/prettyprint/prettyprint-tests.factor
more test IN: cleanup.
[factor.git] / basis / json / prettyprint / prettyprint-tests.factor
1 ! Copyright (C) 2016 Doug Coleman.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: io.streams.string json.prettyprint json.reader tools.test ;
4
5 [
6 "{
7   \"a\": 3
8 }"
9 ] [
10     "{\"a\":3}" json> pprint-json>string
11 ] unit-test
12
13 [ "{ }" ] [ "{ }" json> pprint-json>string ] unit-test
14 [ "[ ]" ] [ "[ ]" json> pprint-json>string ] unit-test
15 [ "null" ] [ "null" json> pprint-json>string ] unit-test
16 [ "false" ] [ "false" json> pprint-json>string ] unit-test
17 [ "3" ] [ "3" json> pprint-json>string ] unit-test
18 [ "[
19   3,
20   4,
21   5
22 ]" ] [ "[3,4,5]" json> pprint-json>string ] unit-test
23
24 [ "{
25   3: 30,
26   4: 40,
27   5: 50
28 }" ] [ "{3:30,4:40,5:50}" json> pprint-json>string ] unit-test