From 50da2e8384512fe37d2dd574d2f29d8d6a1d0c9a Mon Sep 17 00:00:00 2001 From: Heptazhou Date: Sat, 19 Oct 2024 06:30:25 +0000 Subject: [PATCH] Update --- .github/workflows/CI.yml | 7 +++++-- Project.toml | 2 +- src/JSON5.jl | 4 +++- test/async.jl | 4 +--- test/json-samples.jl | 4 ++-- test/lowering.jl | 4 +--- test/runtests.jl | 4 +--- test/serializer.jl | 6 ++---- 8 files changed, 16 insertions(+), 19 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e2df8f3..3fbe4b0 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -25,12 +25,14 @@ jobs: - ubuntu-latest - macos-latest julia-version: - - "1.6" + - "min" + - "lts" - "1" + - "pre" - "nightly" exclude: - os: macos-latest - julia-version: "1.6" + julia-version: "min" steps: - uses: actions/checkout@v4 with: @@ -42,6 +44,7 @@ jobs: - uses: julia-actions/julia-buildpkg@v1 with: ignore-no-cache: true + localregistry: https://github.com/0h7z/0hjl.git - uses: julia-actions/julia-runtest@v1 - uses: heptazhou/julia-codecov@v1 - uses: codecov/codecov-action@v3.1.5 diff --git a/Project.toml b/Project.toml index e7c8263..59155fc 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "JSON5" uuid = "275fdaeb-5887-4102-8704-6b08b28f797b" authors = ["Heptazhou "] -version = "0.21.0" +version = "0.21.1" [deps] Dates = "ade2ca70-3891-5945-98fb-dc099432e06a" diff --git a/src/JSON5.jl b/src/JSON5.jl index 370ff2b..0cc2872 100644 --- a/src/JSON5.jl +++ b/src/JSON5.jl @@ -3,6 +3,8 @@ module JSON5 export json # returns a compact (or indented) JSON representation as a string export JSONText # string wrapper to insert raw JSON into JSON output +const JSON = JSON5 + include("Common.jl") # Parser modules @@ -29,7 +31,7 @@ Writer.lower(json::JSONText) = parse(json.s) function _precompile_() ccall(:jl_generating_output, Cint, ()) == 1 || return nothing x = "{\"type\":\"callback\",\"data\":{\"callback\":1,\"result\":true,\"error\":false}}" - JSON5.lower(JSON5.parse(x)) + JSON.lower(JSON.parse(x)) end _precompile_() diff --git a/test/async.jl b/test/async.jl index 08b8ddd..4db5fca 100644 --- a/test/async.jl +++ b/test/async.jl @@ -1,10 +1,8 @@ -using JSON5 +using JSON5: JSON, JSONText, json using Test using Distributed: RemoteChannel using Sockets -const JSON = JSON5 - @isdefined(a) || include("json-samples.jl") finished_async_tests = RemoteChannel() diff --git a/test/json-samples.jl b/test/json-samples.jl index 85a31b9..f3d29ca 100644 --- a/test/json-samples.jl +++ b/test/json-samples.jl @@ -595,7 +595,7 @@ interop = "{ \"Summary\": \"Kentang Si bungsu dari keluarga Solanum tuberosum L ini ternyata memiliki khasiat untuk mengurangi kerutan jerawat bintik hitam dan kemerahan pada kulit Gunakan seminggu sekali sebagai\", \"Url\": \"http://www.mediaindonesia.com/spaw/uploads/images/potato.jpg\", \"ClickUrl\": \"http://www.mediaindonesia.com/spaw/uploads/images/potato.jpg\", - \"RefererUrl\": \"http://www.mediaindonesia.com/mediaperempuan/index.php?ar_id=Nzkw\", + \"ReferrerUrl\": \"http://www.mediaindonesia.com/mediaperempuan/index.php?ar_id=Nzkw\", \"FileSize\": 22630, \"FileFormat\": \"jpeg\", \"Height\": \"362\", @@ -611,7 +611,7 @@ interop = "{ \"Summary\": \"Introduction of puneri aloo This is a traditional potato preparation flavoured with curry leaves and peanuts and can be eaten on fasting day Preparation time 10 min\", \"Url\": \"http://www.infovisual.info/01/photo/potato.jpg\", \"ClickUrl\": \"http://www.infovisual.info/01/photo/potato.jpg\", - \"RefererUrl\": \"http://sundayfood.com/puneri-aloo-indian-%20recipe\", + \"ReferrerUrl\": \"http://sundayfood.com/puneri-aloo-indian-%20recipe\", \"FileSize\": 119398, \"FileFormat\": \"jpeg\", \"Height\": \"685\", diff --git a/test/lowering.jl b/test/lowering.jl index 3c2310c..bfec72d 100644 --- a/test/lowering.jl +++ b/test/lowering.jl @@ -1,12 +1,10 @@ module TestLowering -using JSON5 +using JSON5: JSON, JSONText, json using Test using Dates using FixedPointNumbers: Fixed -const JSON = JSON5 - @test JSON.json(Date(2016, 8, 3)) == "\"2016-08-03\"" @test JSON.json(:x) == "\"x\"" diff --git a/test/runtests.jl b/test/runtests.jl index 65e1412..5d44ba4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,4 +1,4 @@ -using JSON5 +using JSON5: JSON, JSONText, json using Test using Dates using Distributed: RemoteChannel @@ -6,8 +6,6 @@ using OffsetArrays using DataStructures: DataStructures -const JSON = JSON5 - include("json-samples.jl") @testset "Parser" begin diff --git a/test/serializer.jl b/test/serializer.jl index 5f922fc..cd86a33 100644 --- a/test/serializer.jl +++ b/test/serializer.jl @@ -1,14 +1,12 @@ module TestSerializer -using JSON5 +using JSON5: JSON, JSONText, json using Test -# to define a new serialization behaviour, import these first +# to define a new serialization behavior, import these first using JSON5.Serializations: CommonSerialization, StandardSerialization using JSON5: StructuralContext -const JSON = JSON5 - # those names are long so we can define some type aliases const CS = CommonSerialization const SC = StructuralContext