Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Heptazhou committed Oct 24, 2024
1 parent 6020c54 commit 50da2e8
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 19 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "JSON5"
uuid = "275fdaeb-5887-4102-8704-6b08b28f797b"
authors = ["Heptazhou <zhou at 0h7z dot com>"]
version = "0.21.0"
version = "0.21.1"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
4 changes: 3 additions & 1 deletion src/JSON5.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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_()
Expand Down
4 changes: 1 addition & 3 deletions test/async.jl
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
4 changes: 2 additions & 2 deletions test/json-samples.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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\",
Expand All @@ -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\",
Expand Down
4 changes: 1 addition & 3 deletions test/lowering.jl
Original file line number Diff line number Diff line change
@@ -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\""
Expand Down
4 changes: 1 addition & 3 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using JSON5
using JSON5: JSON, JSONText, json
using Test
using Dates
using Distributed: RemoteChannel
using OffsetArrays

using DataStructures: DataStructures

const JSON = JSON5

include("json-samples.jl")

@testset "Parser" begin
Expand Down
6 changes: 2 additions & 4 deletions test/serializer.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 50da2e8

Please sign in to comment.