-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.py
More file actions
128 lines (123 loc) · 2.93 KB
/
Copy pathtest.py
File metadata and controls
128 lines (123 loc) · 2.93 KB
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import json
from LLMJSONDecoder import custom_json_load
# from LLMJSONToDict2 import LLMJSONDecoder
mocks = [
"""
{some: 1, some: []}
""",
"""
{
some: 1,
some: {other: 2},
some: 23
}
""",
"""
{some: 1, some: {other: 2}, other: {other: 3}}
""",
"""
""",
"""
{"test": 1, "test2": 2}
""",
"""
{"test": {d: 4, f:3}, "test2": 2}
""",
"""
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [4.483605784808901, 51.907188449679325]
}
},
{
"type": "Feature",
"properties": {},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[3.974369110811523 , 51.907355547778565],
[4.173944459020191 , 51.86237166892457 ],
[4.3808076710679416, 51.848867725914914],
[4.579822414365026 , 51.874487141880024],
[4.534413416598767 , 51.9495302480326 ],
[4.365110733567974 , 51.92360787140825 ],
[4.179550508127079 , 51.97336560819281 ],
[4.018096293847009 , 52.00236546429852 ],
[3.9424146309028174, 51.97681895676649 ],
[3.974369110811523 , 51.907355547778565]
]
]
}
}
]
}
""",
"""
{
"type": "Feature", // this is comment
"properties": {},
"geometry": { // this is comment
"type": "Point",
"coordinates": [4.483605784808901, 51.907188449679325]
}
""",
"""
{
"type": "Feature", // this is comment
"properties": {},
"geometry": { // this is comment
"type": "Point",
"coordinates": [4.483605784808901, 51.907188449679325]
}}
""",
"""
{
"address": ["124241, Feature"], // this is comment
properties: {},
"geometry": { // this is comment
"type": "Point", // this is comment
"coordinates": [4.483605784808901, 51.907188449679325]
}
}
""",
"""
{
"address": ["124241, '// this is not comment, Feature"], // this is comment
"properties": {},
"geometry": { // this is comment
"type": "Point", // this is comment
"coordinates": [4.483605784808901, 51.907188449679325]
}
}
""",
"""{
"person": [{
"LastName": "Хорошков",
"firstName": "Никита",
"middleName": "Олегович",
"jobTitle": "Генеральный Директор"
}]
}
""",
"""{/*
"person": [{
"LastName": "Хорошков",
"firstName": "Никита",*/
"middleName": "Олегович",
"jobTitle": "Генеральный Директор"
}]
}
"""
]
# print(mocks[-6])
# print(custom_json_load(mocks[-6]))
for mock in mocks:
print(mock)
print(custom_json_load(mock))