]> gitweb.factorcode.org Git - factor.git/blob - basis/json/prettyprint/prettyprint-tests.factor
90ca80c73a978c08ba8724cee99660b7f20dc3e3
[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 IN: json.prettyprint.tests
5
6 [
7 "{
8   \"a\": 3
9 }"
10 ] [
11     "{\"a\":3}" json> pprint-json>string
12 ] unit-test
13
14 [ "{ }" ] [ "{ }" json> pprint-json>string ] unit-test
15 [ "[ ]" ] [ "[ ]" json> pprint-json>string ] unit-test
16 [ "null" ] [ "null" json> pprint-json>string ] unit-test
17 [ "false" ] [ "false" json> pprint-json>string ] unit-test
18 [ "3" ] [ "3" json> pprint-json>string ] unit-test
19 [ "[
20   3,
21   4,
22   5
23 ]" ] [ "[3,4,5]" json> pprint-json>string ] unit-test
24
25 [ "{
26   3: 30,
27   4: 40,
28   5: 50
29 }" ] [ "{3:30,4:40,5:50}" json> pprint-json>string ] unit-test