pyfracturedjson 2.1.1__tar.gz → 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pyfracturedjson-2.2.0/CHANGELOG.md +37 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/Cargo.lock +11 -12
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/Cargo.toml +2 -2
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/PKG-INFO +2 -1
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/fracturedjson/__init__.py +4 -1
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/fracturedjson/_rust_wrapper.pyi +2 -1
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/pyproject.toml +1 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/src/lib.rs +3 -1
- pyfracturedjson-2.2.0/tests/JSONs/max_prop_name_padding_0.json +53 -0
- pyfracturedjson-2.2.0/tests/JSONs/max_prop_name_padding_24.json +53 -0
- pyfracturedjson-2.2.0/tests/JSONs/number_list_alignment_decimal.json +53 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/common.py +6 -1
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/test_basic_output.py +1 -1
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/test_builtin_wrapper.py +3 -4
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/.github/workflows/publish.yml +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/.gitignore +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/LICENSE +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/README.md +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/compact_array_complexity_-1.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/compact_array_complexity_0.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/compact_array_complexity_1.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/default_settings.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/indent_2.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/indent_3.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/inline_complexity_-1.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/inline_complexity_0.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/inline_complexity_1.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/line_len_100.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/line_len_40.json +0 -0
- /pyfracturedjson-2.1.1/tests/JSONs/number_list_alignment_decimal.json → /pyfracturedjson-2.2.0/tests/JSONs/max_prop_name_padding_10.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/number_list_alignment_left.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/number_list_alignment_normalize.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/number_list_alignment_right.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/table_row_complexity_-1.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/table_row_complexity_0.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/table_row_complexity_1.json +0 -0
- {pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/uv.lock +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
## [2.1.1] - 2026-06-03
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Support for android
|
|
13
|
+
- `aarch64-linux-android`
|
|
14
|
+
- `x86_64-linux-android`
|
|
15
|
+
|
|
16
|
+
## [2.1.0] - 2026-06-03
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
- More options
|
|
21
|
+
- `max_inline_complexity`
|
|
22
|
+
- `max_compact_array_complexity`
|
|
23
|
+
- `max_table_row_complexity`
|
|
24
|
+
- `number_list_alignment`
|
|
25
|
+
- Licence file
|
|
26
|
+
|
|
27
|
+
## [2.0.0] - 2026-02-26
|
|
28
|
+
|
|
29
|
+
### Fixed
|
|
30
|
+
|
|
31
|
+
- Package not being correctly uploaded to PyPi
|
|
32
|
+
|
|
33
|
+
## [1.0.0] - 2026-02-04
|
|
34
|
+
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- Wrapper functions to mirror the builtin `json` library
|
|
@@ -168,7 +168,7 @@ dependencies = [
|
|
|
168
168
|
|
|
169
169
|
[[package]]
|
|
170
170
|
name = "pyfracturedjson"
|
|
171
|
-
version = "2.
|
|
171
|
+
version = "2.2.0"
|
|
172
172
|
dependencies = [
|
|
173
173
|
"fracturedjson",
|
|
174
174
|
"pyo3",
|
|
@@ -176,9 +176,9 @@ dependencies = [
|
|
|
176
176
|
|
|
177
177
|
[[package]]
|
|
178
178
|
name = "pyo3"
|
|
179
|
-
version = "0.
|
|
179
|
+
version = "0.29.0"
|
|
180
180
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
181
|
-
checksum = "
|
|
181
|
+
checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c"
|
|
182
182
|
dependencies = [
|
|
183
183
|
"libc",
|
|
184
184
|
"once_cell",
|
|
@@ -190,18 +190,18 @@ dependencies = [
|
|
|
190
190
|
|
|
191
191
|
[[package]]
|
|
192
192
|
name = "pyo3-build-config"
|
|
193
|
-
version = "0.
|
|
193
|
+
version = "0.29.0"
|
|
194
194
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
195
|
-
checksum = "
|
|
195
|
+
checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078"
|
|
196
196
|
dependencies = [
|
|
197
197
|
"target-lexicon",
|
|
198
198
|
]
|
|
199
199
|
|
|
200
200
|
[[package]]
|
|
201
201
|
name = "pyo3-ffi"
|
|
202
|
-
version = "0.
|
|
202
|
+
version = "0.29.0"
|
|
203
203
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
204
|
-
checksum = "
|
|
204
|
+
checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b"
|
|
205
205
|
dependencies = [
|
|
206
206
|
"libc",
|
|
207
207
|
"pyo3-build-config",
|
|
@@ -209,9 +209,9 @@ dependencies = [
|
|
|
209
209
|
|
|
210
210
|
[[package]]
|
|
211
211
|
name = "pyo3-macros"
|
|
212
|
-
version = "0.
|
|
212
|
+
version = "0.29.0"
|
|
213
213
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
214
|
-
checksum = "
|
|
214
|
+
checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771"
|
|
215
215
|
dependencies = [
|
|
216
216
|
"proc-macro2",
|
|
217
217
|
"pyo3-macros-backend",
|
|
@@ -221,13 +221,12 @@ dependencies = [
|
|
|
221
221
|
|
|
222
222
|
[[package]]
|
|
223
223
|
name = "pyo3-macros-backend"
|
|
224
|
-
version = "0.
|
|
224
|
+
version = "0.29.0"
|
|
225
225
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
226
|
-
checksum = "
|
|
226
|
+
checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362"
|
|
227
227
|
dependencies = [
|
|
228
228
|
"heck",
|
|
229
229
|
"proc-macro2",
|
|
230
|
-
"pyo3-build-config",
|
|
231
230
|
"quote",
|
|
232
231
|
"syn",
|
|
233
232
|
]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[package]
|
|
2
2
|
name = "pyfracturedjson"
|
|
3
|
-
version = "2.
|
|
3
|
+
version = "2.2.0"
|
|
4
4
|
edition = "2024"
|
|
5
5
|
license = "MIT"
|
|
6
6
|
readme = "README.md"
|
|
@@ -16,5 +16,5 @@ crate-type = ["cdylib"]
|
|
|
16
16
|
fracturedjson = "0.1.1"
|
|
17
17
|
|
|
18
18
|
[dependencies.pyo3]
|
|
19
|
-
version = "0.
|
|
19
|
+
version = "0.29.0"
|
|
20
20
|
features = ["extension-module", "abi3-py39"]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pyfracturedjson
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Classifier: Programming Language :: Rust
|
|
5
5
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
6
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
@@ -10,6 +10,7 @@ Keywords: json,formatter,fracturedjson,compact,readable
|
|
|
10
10
|
License-Expression: MIT
|
|
11
11
|
Requires-Python: >=3.9
|
|
12
12
|
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
13
|
+
Project-URL: Changelog, https://github.com/g-b-f/pyFracturedJSON/blob/master/CHANGELOG.md
|
|
13
14
|
Project-URL: Repository, https://github.com/g-b-f/pyFracturedJSON
|
|
14
15
|
|
|
15
16
|
# pyFracturedJSON
|
|
@@ -21,6 +21,7 @@ class Encoder(json.encoder.JSONEncoder):
|
|
|
21
21
|
max_compact_array_complexity = 2,
|
|
22
22
|
max_table_row_complexity = 2,
|
|
23
23
|
number_list_alignment= "decimal",
|
|
24
|
+
max_prop_name_padding = 16,
|
|
24
25
|
**kwargs
|
|
25
26
|
):
|
|
26
27
|
super().__init__(
|
|
@@ -42,6 +43,7 @@ class Encoder(json.encoder.JSONEncoder):
|
|
|
42
43
|
self.max_compact_array_complexity = max_compact_array_complexity
|
|
43
44
|
self.max_table_row_complexity = max_table_row_complexity
|
|
44
45
|
self.number_list_alignment = number_list_alignment
|
|
46
|
+
self.max_prop_name_padding = max_prop_name_padding
|
|
45
47
|
|
|
46
48
|
|
|
47
49
|
|
|
@@ -54,7 +56,8 @@ class Encoder(json.encoder.JSONEncoder):
|
|
|
54
56
|
max_inline_complexity = self.max_inline_complexity,
|
|
55
57
|
max_compact_array_complexity = self.max_compact_array_complexity,
|
|
56
58
|
max_table_row_complexity = self.max_table_row_complexity,
|
|
57
|
-
number_list_alignment = self.number_list_alignment
|
|
59
|
+
number_list_alignment = self.number_list_alignment,
|
|
60
|
+
max_prop_name_padding = self.max_prop_name_padding
|
|
58
61
|
)
|
|
59
62
|
return formatted
|
|
60
63
|
|
|
@@ -9,7 +9,8 @@ fn reformat_string(
|
|
|
9
9
|
max_inline_complexity: isize,
|
|
10
10
|
max_compact_array_complexity: isize,
|
|
11
11
|
max_table_row_complexity: isize,
|
|
12
|
-
number_list_alignment: &str
|
|
12
|
+
number_list_alignment: &str,
|
|
13
|
+
max_prop_name_padding: usize
|
|
13
14
|
) -> String {
|
|
14
15
|
let mut formatter = Formatter::new();
|
|
15
16
|
formatter.options.max_total_line_length = line_length;
|
|
@@ -17,6 +18,7 @@ fn reformat_string(
|
|
|
17
18
|
formatter.options.max_inline_complexity = max_inline_complexity;
|
|
18
19
|
formatter.options.max_compact_array_complexity = max_compact_array_complexity;
|
|
19
20
|
formatter.options.max_table_row_complexity = max_table_row_complexity;
|
|
21
|
+
formatter.options.max_prop_name_padding = max_prop_name_padding;
|
|
20
22
|
|
|
21
23
|
match number_list_alignment {
|
|
22
24
|
"left" => formatter.options.number_list_alignment = NumberListAlignment::Left,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"BasicObject": {
|
|
3
|
+
"ModuleId": "armor",
|
|
4
|
+
"Name": "",
|
|
5
|
+
"Locations": [
|
|
6
|
+
[11, 2], [11, 3], [11, 4], [11, 5], [11, 6], [11, 7], [11, 8], [11, 9], [11, 10], [11, 11],
|
|
7
|
+
[11, 12], [11, 13], [11, 14], [ 1, 14], [ 1, 13], [ 1, 12], [ 1, 11], [ 1, 10], [ 1, 9], [ 1, 8],
|
|
8
|
+
[ 1, 7], [ 1, 6], [ 1, 5], [ 1, 4], [ 1, 3], [ 1, 2], [ 4, 2], [ 5, 2], [ 6, 2], [ 7, 2],
|
|
9
|
+
[ 8, 2], [ 8, 3], [ 7, 3], [ 6, 3], [ 5, 3], [ 4, 3], [ 0, 4], [ 0, 5], [ 0, 6], [ 0, 7],
|
|
10
|
+
[ 0, 8], [12, 8], [12, 7], [12, 6], [12, 5], [12, 4]
|
|
11
|
+
],
|
|
12
|
+
"Orientation": "Fore",
|
|
13
|
+
"Seed": 272691529
|
|
14
|
+
},
|
|
15
|
+
"SimilarArrays": {
|
|
16
|
+
"Katherine": ["blue", "lightblue", "black" ],
|
|
17
|
+
"Logan" : ["yellow", "blue", "black", "red"],
|
|
18
|
+
"Erik" : ["red", "purple" ],
|
|
19
|
+
"Jean" : ["lightgreen", "yellow", "black" ]
|
|
20
|
+
},
|
|
21
|
+
"SimilarObjects": [
|
|
22
|
+
{ "type": "turret", "hp": 400, "loc": {"x": 47, "y": -4}, "flags": "S" },
|
|
23
|
+
{ "type": "assassin", "hp": 80, "loc": {"x": 12, "y": 6}, "flags": "Q" },
|
|
24
|
+
{ "type": "berserker", "hp": 150, "loc": {"x": 0, "y": 0} },
|
|
25
|
+
{ "type": "pittrap", "loc": {"x": 10, "y": -14}, "flags": "S,I" }
|
|
26
|
+
],
|
|
27
|
+
"NumberAlignmentTests": [
|
|
28
|
+
{"a": 123.456 , "b": 0 , "c": 0 },
|
|
29
|
+
{"a": 234567.8 , "b": 0 , "c": 0 },
|
|
30
|
+
{"a": 3 , "b": 0.0 , "c": 700.0},
|
|
31
|
+
{"a": null , "b": 0.2 , "c": 800.0},
|
|
32
|
+
{"a": 5.6789, "b": 0.35, "c": 0 }
|
|
33
|
+
],
|
|
34
|
+
"InlineComplexityTests": {
|
|
35
|
+
"Subthing1": {"X": 55, "Y": 19, "Z": -4},
|
|
36
|
+
"Subthing2": { "Q": null, "W": [-2, -1, 0, 1] },
|
|
37
|
+
"Distraction": [[], null, null]
|
|
38
|
+
},
|
|
39
|
+
"CompactArrayComplexityTest_1": [
|
|
40
|
+
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79,
|
|
41
|
+
83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193,
|
|
42
|
+
197, 199
|
|
43
|
+
],
|
|
44
|
+
"CompactArrayComplexityTest_2": [
|
|
45
|
+
[19, 2], [ 3, 8], [14, 0], [ 9, 9], [ 9, 9], [ 0, 3], [10, 1], [ 9, 1], [ 9, 2], [ 6, 13], [18, 5],
|
|
46
|
+
[ 4, 11], [12, 2]
|
|
47
|
+
],
|
|
48
|
+
"TableRowComplexityTests": {
|
|
49
|
+
"Rect" : { "position": {"x": -44, "y": 3.4 }, "color": [0, 255, 255] },
|
|
50
|
+
"Point": { "position": { "y": 22.0, "z": 3} },
|
|
51
|
+
"Oval" : { "position": null, "color": "#7f3e96" }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"BasicObject" : {
|
|
3
|
+
"ModuleId" : "armor",
|
|
4
|
+
"Name" : "",
|
|
5
|
+
"Locations" : [
|
|
6
|
+
[11, 2], [11, 3], [11, 4], [11, 5], [11, 6], [11, 7], [11, 8], [11, 9], [11, 10], [11, 11],
|
|
7
|
+
[11, 12], [11, 13], [11, 14], [ 1, 14], [ 1, 13], [ 1, 12], [ 1, 11], [ 1, 10], [ 1, 9], [ 1, 8],
|
|
8
|
+
[ 1, 7], [ 1, 6], [ 1, 5], [ 1, 4], [ 1, 3], [ 1, 2], [ 4, 2], [ 5, 2], [ 6, 2], [ 7, 2],
|
|
9
|
+
[ 8, 2], [ 8, 3], [ 7, 3], [ 6, 3], [ 5, 3], [ 4, 3], [ 0, 4], [ 0, 5], [ 0, 6], [ 0, 7],
|
|
10
|
+
[ 0, 8], [12, 8], [12, 7], [12, 6], [12, 5], [12, 4]
|
|
11
|
+
],
|
|
12
|
+
"Orientation": "Fore",
|
|
13
|
+
"Seed" : 272691529
|
|
14
|
+
},
|
|
15
|
+
"SimilarArrays" : {
|
|
16
|
+
"Katherine": ["blue", "lightblue", "black" ],
|
|
17
|
+
"Logan" : ["yellow", "blue", "black", "red"],
|
|
18
|
+
"Erik" : ["red", "purple" ],
|
|
19
|
+
"Jean" : ["lightgreen", "yellow", "black" ]
|
|
20
|
+
},
|
|
21
|
+
"SimilarObjects" : [
|
|
22
|
+
{ "type": "turret", "hp": 400, "loc": {"x": 47, "y": -4}, "flags": "S" },
|
|
23
|
+
{ "type": "assassin", "hp": 80, "loc": {"x": 12, "y": 6}, "flags": "Q" },
|
|
24
|
+
{ "type": "berserker", "hp": 150, "loc": {"x": 0, "y": 0} },
|
|
25
|
+
{ "type": "pittrap", "loc": {"x": 10, "y": -14}, "flags": "S,I" }
|
|
26
|
+
],
|
|
27
|
+
"NumberAlignmentTests" : [
|
|
28
|
+
{"a": 123.456 , "b": 0 , "c": 0 },
|
|
29
|
+
{"a": 234567.8 , "b": 0 , "c": 0 },
|
|
30
|
+
{"a": 3 , "b": 0.0 , "c": 700.0},
|
|
31
|
+
{"a": null , "b": 0.2 , "c": 800.0},
|
|
32
|
+
{"a": 5.6789, "b": 0.35, "c": 0 }
|
|
33
|
+
],
|
|
34
|
+
"InlineComplexityTests" : {
|
|
35
|
+
"Subthing1" : {"X": 55, "Y": 19, "Z": -4},
|
|
36
|
+
"Subthing2" : { "Q": null, "W": [-2, -1, 0, 1] },
|
|
37
|
+
"Distraction": [[], null, null]
|
|
38
|
+
},
|
|
39
|
+
"CompactArrayComplexityTest_1": [
|
|
40
|
+
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79,
|
|
41
|
+
83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193,
|
|
42
|
+
197, 199
|
|
43
|
+
],
|
|
44
|
+
"CompactArrayComplexityTest_2": [
|
|
45
|
+
[19, 2], [ 3, 8], [14, 0], [ 9, 9], [ 9, 9], [ 0, 3], [10, 1], [ 9, 1], [ 9, 2], [ 6, 13], [18, 5],
|
|
46
|
+
[ 4, 11], [12, 2]
|
|
47
|
+
],
|
|
48
|
+
"TableRowComplexityTests" : {
|
|
49
|
+
"Rect" : { "position": {"x": -44, "y": 3.4 }, "color": [0, 255, 255] },
|
|
50
|
+
"Point": { "position": { "y": 22.0, "z": 3} },
|
|
51
|
+
"Oval" : { "position": null, "color": "#7f3e96" }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"BasicObject": {
|
|
3
|
+
"ModuleId" : "armor",
|
|
4
|
+
"Name" : "",
|
|
5
|
+
"Locations" : [
|
|
6
|
+
[11, 2], [11, 3], [11, 4], [11, 5], [11, 6], [11, 7], [11, 8], [11, 9], [11, 10], [11, 11],
|
|
7
|
+
[11, 12], [11, 13], [11, 14], [ 1, 14], [ 1, 13], [ 1, 12], [ 1, 11], [ 1, 10], [ 1, 9], [ 1, 8],
|
|
8
|
+
[ 1, 7], [ 1, 6], [ 1, 5], [ 1, 4], [ 1, 3], [ 1, 2], [ 4, 2], [ 5, 2], [ 6, 2], [ 7, 2],
|
|
9
|
+
[ 8, 2], [ 8, 3], [ 7, 3], [ 6, 3], [ 5, 3], [ 4, 3], [ 0, 4], [ 0, 5], [ 0, 6], [ 0, 7],
|
|
10
|
+
[ 0, 8], [12, 8], [12, 7], [12, 6], [12, 5], [12, 4]
|
|
11
|
+
],
|
|
12
|
+
"Orientation": "Fore",
|
|
13
|
+
"Seed" : 272691529
|
|
14
|
+
},
|
|
15
|
+
"SimilarArrays": {
|
|
16
|
+
"Katherine": ["blue", "lightblue", "black" ],
|
|
17
|
+
"Logan" : ["yellow", "blue", "black", "red"],
|
|
18
|
+
"Erik" : ["red", "purple" ],
|
|
19
|
+
"Jean" : ["lightgreen", "yellow", "black" ]
|
|
20
|
+
},
|
|
21
|
+
"SimilarObjects": [
|
|
22
|
+
{ "type": "turret", "hp": 400, "loc": {"x": 47, "y": -4}, "flags": "S" },
|
|
23
|
+
{ "type": "assassin", "hp": 80, "loc": {"x": 12, "y": 6}, "flags": "Q" },
|
|
24
|
+
{ "type": "berserker", "hp": 150, "loc": {"x": 0, "y": 0} },
|
|
25
|
+
{ "type": "pittrap", "loc": {"x": 10, "y": -14}, "flags": "S,I" }
|
|
26
|
+
],
|
|
27
|
+
"NumberAlignmentTests": [
|
|
28
|
+
{"a": 123.456 , "b": 0 , "c": 0 },
|
|
29
|
+
{"a": 234567.8 , "b": 0 , "c": 0 },
|
|
30
|
+
{"a": 3 , "b": 0.0 , "c": 700.0},
|
|
31
|
+
{"a": null , "b": 0.2 , "c": 800.0},
|
|
32
|
+
{"a": 5.6789, "b": 0.35, "c": 0 }
|
|
33
|
+
],
|
|
34
|
+
"InlineComplexityTests": {
|
|
35
|
+
"Subthing1" : {"X": 55, "Y": 19, "Z": -4},
|
|
36
|
+
"Subthing2" : { "Q": null, "W": [-2, -1, 0, 1] },
|
|
37
|
+
"Distraction": [[], null, null]
|
|
38
|
+
},
|
|
39
|
+
"CompactArrayComplexityTest_1": [
|
|
40
|
+
2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79,
|
|
41
|
+
83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193,
|
|
42
|
+
197, 199
|
|
43
|
+
],
|
|
44
|
+
"CompactArrayComplexityTest_2": [
|
|
45
|
+
[19, 2], [ 3, 8], [14, 0], [ 9, 9], [ 9, 9], [ 0, 3], [10, 1], [ 9, 1], [ 9, 2], [ 6, 13], [18, 5],
|
|
46
|
+
[ 4, 11], [12, 2]
|
|
47
|
+
],
|
|
48
|
+
"TableRowComplexityTests": {
|
|
49
|
+
"Rect" : { "position": {"x": -44, "y": 3.4 }, "color": [0, 255, 255] },
|
|
50
|
+
"Point": { "position": { "y": 22.0, "z": 3} },
|
|
51
|
+
"Oval" : { "position": null, "color": "#7f3e96" }
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import json
|
|
2
|
-
from pathlib import Path
|
|
3
2
|
import sys
|
|
3
|
+
from pathlib import Path
|
|
4
4
|
|
|
5
5
|
root = Path(__file__).parent.parent
|
|
6
6
|
sys.path.append(str(root))
|
|
7
7
|
|
|
8
8
|
from fracturedjson import Encoder
|
|
9
9
|
|
|
10
|
+
|
|
10
11
|
def read_file(filename:str) -> tuple[str, dict]:
|
|
11
12
|
file = Path(__file__).parent / filename
|
|
12
13
|
file_contents = file.read_text()
|
|
@@ -41,6 +42,10 @@ _params: list[paramType] = [
|
|
|
41
42
|
("number_list_alignment_decimal.json", {"number_list_alignment":"decimal"}),
|
|
42
43
|
("number_list_alignment_right.json", {"number_list_alignment":"right"}),
|
|
43
44
|
("number_list_alignment_normalize.json", {"number_list_alignment":"normalize"}),
|
|
45
|
+
|
|
46
|
+
("max_prop_name_padding_0.json", {"max_prop_name_padding":0}),
|
|
47
|
+
("max_prop_name_padding_10.json", {"max_prop_name_padding":10}),
|
|
48
|
+
("max_prop_name_padding_24.json", {"max_prop_name_padding":24}),
|
|
44
49
|
]
|
|
45
50
|
|
|
46
51
|
JSONS_DIR = "JSONs/"
|
|
@@ -4,9 +4,9 @@ from pathlib import Path
|
|
|
4
4
|
import pytest
|
|
5
5
|
|
|
6
6
|
from fracturedjson import Encoder
|
|
7
|
-
|
|
8
7
|
from tests.common import params, read_file
|
|
9
8
|
|
|
9
|
+
|
|
10
10
|
@pytest.mark.parametrize(("filename", "kwargs"), params)
|
|
11
11
|
def test_roundtrip(filename:str, kwargs:dict):
|
|
12
12
|
file_str, file_dict = read_file(filename)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import json as builtin_json
|
|
2
1
|
from pathlib import Path
|
|
3
2
|
|
|
4
3
|
import pytest
|
|
5
4
|
|
|
6
5
|
import fracturedjson as json
|
|
7
|
-
|
|
8
6
|
from tests.common import params, read_file
|
|
9
7
|
|
|
8
|
+
|
|
10
9
|
@pytest.mark.parametrize(("filename", "kwargs"), params)
|
|
11
10
|
def test_dumps(filename:str, kwargs:dict):
|
|
12
11
|
file_str, file_dict = read_file(filename)
|
|
@@ -22,14 +21,14 @@ def test_dump(filename:str, kwargs:dict, tmp_path:Path):
|
|
|
22
21
|
assert file.read_text() == file_str
|
|
23
22
|
|
|
24
23
|
@pytest.mark.parametrize(("filename", "kwargs"), params)
|
|
25
|
-
def test_load(filename:str, kwargs:dict
|
|
24
|
+
def test_load(filename:str, kwargs:dict):
|
|
26
25
|
file_str, file_dict = read_file(filename)
|
|
27
26
|
with open(Path(__file__).parent / filename) as f:
|
|
28
27
|
data = json.load(f)
|
|
29
28
|
assert file_dict == data
|
|
30
29
|
|
|
31
30
|
@pytest.mark.parametrize(("filename", "kwargs"), params)
|
|
32
|
-
def test_loads(filename:str, kwargs:dict
|
|
31
|
+
def test_loads(filename:str, kwargs:dict):
|
|
33
32
|
file_str, file_dict = read_file(filename)
|
|
34
33
|
data = json.loads(file_str)
|
|
35
34
|
assert file_dict == data
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/compact_array_complexity_-1.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/number_list_alignment_normalize.json
RENAMED
|
File without changes
|
{pyfracturedjson-2.1.1 → pyfracturedjson-2.2.0}/tests/JSONs/number_list_alignment_right.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|