diff tests/testJson.ur @ 0:63697ef80a2c

JSON, minus records and nulls
author Adam Chlipala <adam@chlipala.net>
date Thu, 02 Dec 2010 11:10:57 -0500
parents
children 4d103b4450ee
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/testJson.ur	Thu Dec 02 11:10:57 2010 -0500
@@ -0,0 +1,13 @@
+fun main () : transaction page = return <xml><body>
+  {[Json.toJson (1 :: 2 :: 8 :: [])]}<br/>
+  {[Json.fromJson "[1,2, 8]" : list int]}
+  <hr/>
+  {[Json.toJson (1.2 :: 2.4 :: (-8.8) :: [])]}<br/>
+  {[Json.fromJson "[1.4,-2.7, 8.215506]" : list float]}
+  <hr/>
+  {[Json.toJson ("hi" :: "bye" :: "tricky\\\" one!" :: [])]}<br/>
+  {[Json.fromJson "[\"abc\", \"\\\\whoa\"]" : list string]}
+  <hr/>
+  {[Json.toJson (True :: False :: True :: [])]}<br/>
+  {[Json.fromJson "[true,false, true]" : list bool]}
+</body></xml>