30 lines
709 B
Factor
30 lines
709 B
Factor
|
! Copyright (C) 2016 Doug Coleman.
|
||
|
! See http://factorcode.org/license.txt for BSD license.
|
||
|
USING: io.streams.string json.prettyprint json.reader tools.test ;
|
||
|
IN: json.prettyprint.tests
|
||
|
|
||
|
[
|
||
|
"{
|
||
|
\"a\": 3
|
||
|
}"
|
||
|
] [
|
||
|
"{\"a\":3}" json> pprint-json>string
|
||
|
] unit-test
|
||
|
|
||
|
[ "{ }" ] [ "{ }" json> pprint-json>string ] unit-test
|
||
|
[ "[ ]" ] [ "[ ]" json> pprint-json>string ] unit-test
|
||
|
[ "null" ] [ "null" json> pprint-json>string ] unit-test
|
||
|
[ "false" ] [ "false" json> pprint-json>string ] unit-test
|
||
|
[ "3" ] [ "3" json> pprint-json>string ] unit-test
|
||
|
[ "[
|
||
|
3,
|
||
|
4,
|
||
|
5
|
||
|
]" ] [ "[3,4,5]" json> pprint-json>string ] unit-test
|
||
|
|
||
|
[ "{
|
||
|
3: 30,
|
||
|
4: 40,
|
||
|
5: 50
|
||
|
}" ] [ "{3:30,4:40,5:50}" json> pprint-json>string ] unit-test
|