Idris2/tests/contrib/json_001/CharEncoding.idr

19 lines
425 B
Idris
Raw Normal View History

2021-04-22 10:30:56 +03:00
import Language.JSON
import Data.List
import Data.String
main : IO ()
main = printLn $ filter (not . roundTrips) chars
where chars : List Int
chars = [0 .. 55295]
roundTrips : Int -> Bool
roundTrips n =
let s = singleton $ chr n
v = JString s
in case parse (show v) of
Just (JString x) => x == s
_ => False