def main
import qasim-bend-kit@0.1.0.2/usage/JSON_SafeTest.bend as JSONSafeTestimport Base
37def main() -> IO(Unit):
38 do IO<Unit>:
39 sample_ok : Bool = valid_roundtrip("{\"shop\":\"Bend & Thread\",\"active\":true,\"currency\":\"USD\",\"items\":[{\"listing_id\":84512037,\"title\":\"Handwoven linen table runner\",\"price\":42.5,\"tags\":[\"linen\",\"table decor\",\"handmade\"],\"personalization_enabled\":false},{\"listing_id\":84512038,\"title\":\"Indigo napkins\",\"price\":18.0,\"tags\":[],\"personalization_enabled\":true}],\"notes\":null}")
40 check(sample_ok, "assets/sample.json round trip")
41 check(valid_roundtrip("[null,true,false,0,-3,1.2e+4,\"ok\"]"), "nested values and numbers")
42 check(rejects("01") && rejects("1.") && rejects("[1,]") && rejects("{\"x\":}"), "malformed JSON")
43 IO.print("JSON parser tests passed")
Uses (9)
Used by (0)
No other definition uses this definition.