aboutsummaryrefslogtreecommitdiff
path: root/tests/lang/eval-okay-fromjson.nix
blob: 4c526b9ae5d6f4667da7f698616eddd65cab2d6d (plain)
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
30
31
32
33
34
35
36
37
38
39
40
41
builtins.fromJSON
  ''
    {
      "Video": {
          "Title":  "The Penguin Chronicles",
          "Width":  1920,
          "Height": 1080,
          "EmbeddedData": [3.14159, 23493,null, true  ,false, -10],
          "Thumb": {
              "Url":    "http://www.example.com/video/5678931",
              "Width":  200,
              "Height": 250
          },
          "Animated" : false,
          "IDs": [116, 943, 234, 38793, true  ,false,null, -100],
          "Escapes": "\"\\\/\t\n\r\t",
          "Subtitle" : false,
          "Latitude":  37.7668,
          "Longitude": -122.3959
        }
    }
  ''
==
  { Video =
    { Title = "The Penguin Chronicles";
      Width = 1920;
      Height = 1080;
      EmbeddedData = [ 3.14159 23493 null true false (0-10) ];
      Thumb =
        { Url = "http://www.example.com/video/5678931";
          Width = 200;
          Height = 250;
        };
      Animated = false;
      IDs = [ 116 943 234 38793 true false null (0-100) ];
      Escapes = "\"\\\/\t\n\r\t";  # supported in JSON but not Nix: \b\f
      Subtitle = false;
      Latitude = 37.7668;
      Longitude = -122.3959;
    };
  }