python (3.12.0)
1 from test.test_json import PyTest, CTest
2
3
4 # from https://json.org/JSON_checker/test/pass2.json
5 JSON = r'''
6 [[[[[[[[[[[[[[[[[[["Not too deep"]]]]]]]]]]]]]]]]]]]
7 '''
8
9 class ESC[4;38;5;81mTestPass2:
10 def test_parse(self):
11 # test in/out equivalence and parsing
12 res = self.loads(JSON)
13 out = self.dumps(res)
14 self.assertEqual(res, self.loads(out))
15
16
17 class ESC[4;38;5;81mTestPyPass2(ESC[4;38;5;149mTestPass2, ESC[4;38;5;149mPyTest): pass
18 class ESC[4;38;5;81mTestCPass2(ESC[4;38;5;149mTestPass2, ESC[4;38;5;149mCTest): pass