1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-09 20:16:03 +01:00

Add test case for json with comments

This commit is contained in:
Farid Zakaria 2025-07-24 20:17:38 -07:00
parent d4c562c6ff
commit d95ff93e70
2 changed files with 62 additions and 0 deletions

View file

@ -0,0 +1 @@
true

View file

@ -0,0 +1,61 @@
builtins.fromJSON ''
{
// This is a comment
"Video": {
/* Multi line comment single line */
"Title": "The Penguin Chronicles",
"Width": 1920,
"Height": 1080,
/**
* Multi line comment
* with multiple lines
*/
"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;
};
}