python (3.12.0)
1 from test.test_json import PyTest, CTest
2
3
4 # from https://json.org/JSON_checker/test/pass3.json
5 JSON = r'''
6 {
7 "JSON Test Pattern pass3": {
8 "The outermost value": "must be an object or array.",
9 "In this test": "It is an object."
10 }
11 }
12 '''
13
14
15 class ESC[4;38;5;81mTestPass3:
16 def test_parse(self):
17 # test in/out equivalence and parsing
18 res = self.loads(JSON)
19 out = self.dumps(res)
20 self.assertEqual(res, self.loads(out))
21
22
23 class ESC[4;38;5;81mTestPyPass3(ESC[4;38;5;149mTestPass3, ESC[4;38;5;149mPyTest): pass
24 class ESC[4;38;5;81mTestCPass3(ESC[4;38;5;149mTestPass3, ESC[4;38;5;149mCTest): pass