def test_multi_line_comments
source = %Q{
/* comment before
* document */
{
/* comment */
"foo": "1",
"bar": "2",
/* another
comment
*/
"baz": "3",
"array": [
/* comment inside array */
1, 2, 3,
4, /* comment inside an array */ 5,
/*
// "nested" comments
{ "faux json": "inside comment" }
*/
6, 7
/**
* comment at end of array
*/
]
/**************************
comment at end of hash
**************************/
}
/* comment after
document */
}
doc = { "foo" => "1", "bar" => "2", "baz" => "3", "array" => [1, 2, 3, 4, 5, 6, 7] }
assert_equal(doc, JSON.parse(source))
end