File: fixtures.ml

package info (click to toggle)
yojson 2.0.2-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,044 kB
  • sloc: ml: 3,068; makefile: 38
file content (29 lines) | stat: -rw-r--r-- 596 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
let json_value =
  `Assoc
    [ ("null", `Null)
    ; ("bool", `Bool true)
    ; ("int", `Int 0)
    ; ("intlit", `Intlit "10000000000000000000")
    ; ("float", `Float 0.)
    ; ("string", `String "string")
    ; ("list", `List [`Int 0; `Int 1; `Int 2])
    ]

let json_string =
  "{"
  ^ {|"null":null,|}
  ^ {|"bool":true,|}
  ^ {|"int":0,|}
  ^ {|"intlit":10000000000000000000,|}
  ^ {|"float":0.0,|}
  ^ {|"string":"string",|}
  ^ {|"list":[0,1,2]|}
  ^ "}"

let unquoted_json = {|{foo: null}|}

let unquoted_value = `Assoc [("foo", `Null)]

let json_string_newline =
  json_string
  ^ "\n"