Skip to content

Commit 55e5304

Browse files
authored
Fix formatting inconsistencies of high-precision real numbers (#549)
Signed-off-by: Juan Cruz Viotti <[email protected]>
1 parent f478aee commit 55e5304

File tree

7 files changed

+78
-33
lines changed

7 files changed

+78
-33
lines changed

DEPENDENCIES

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
vendorpull https://github.com/sourcemeta/vendorpull 1dcbac42809cf87cb5b045106b863e17ad84ba02
2-
core https://github.com/sourcemeta/core e275b0cc6db3814eae39b978d939d9040d5f2df9
2+
core https://github.com/sourcemeta/core 8b34af868820407091f108486798b4c73dec6631
33
jsonbinpack https://github.com/sourcemeta/jsonbinpack abd40e41050d14d74af1fddb5c397de5cca3b13c
4-
blaze https://github.com/sourcemeta/blaze 80ae890a35c7897e756af7edf6da9585fa2729da
4+
blaze https://github.com/sourcemeta/blaze bfdc479b5ae0c17a356be5f42dcc713ab31f976a
55
hydra https://github.com/sourcemeta/hydra af9f2c54709d620872ead0c3f8f683c15a0fa702

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ add_jsonschema_test_unix(format/fail_unknown_metaschema)
5252
add_jsonschema_test_unix(format/pass_default_dialect)
5353
add_jsonschema_test_unix(format/pass_default_dialect_config)
5454
add_jsonschema_test_unix(format/pass_default_dialect_config_relative)
55+
add_jsonschema_test_unix(format/pass_bignum_real)
5556

5657
# Validate
5758
add_jsonschema_test_unix(validate/fail_instance_directory)

test/bundle/pass_bigint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ cat << 'EOF' > "$TMP/expected.json"
3636
"$schema": "https://json-schema.org/draft/2020-12/schema",
3737
"$id": "https://example.com/nested",
3838
"type": "integer",
39-
"exclusiveMaximum": 9223372036854776000
39+
"exclusiveMaximum": 9.223372036854776000e+18
4040
}
4141
}
4242
}

test/format/pass_bignum_real.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/sh
2+
3+
set -o errexit
4+
set -o nounset
5+
6+
TMP="$(mktemp -d)"
7+
clean() { rm -rf "$TMP"; }
8+
trap clean EXIT
9+
10+
cat << 'EOF' > "$TMP/schema.json"
11+
{
12+
"$schema": "http://json-schema.org/draft-04/schema#",
13+
"minimum": 1e-05
14+
}
15+
EOF
16+
17+
"$1" fmt "$TMP/schema.json"
18+
19+
cat << 'EOF' > "$TMP/expected.json"
20+
{
21+
"$schema": "http://json-schema.org/draft-04/schema#",
22+
"minimum": 1e-5
23+
}
24+
EOF
25+
26+
diff "$TMP/schema.json" "$TMP/expected.json"

vendor/blaze/src/evaluator/evaluator_describe.cc

Lines changed: 37 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/core/src/core/json/stringify.h

Lines changed: 8 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vendor/core/src/lang/numeric/decimal.cc

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)