-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
* Add singleton support * add back commented test * bump JSON3 and StructTypes version * bump structtypes version
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,8 @@ struct D | |
c::String | ||
end | ||
|
||
struct ParametricSingleton{T} end | ||
|
||
abstract type Vehicle end | ||
|
||
struct Car <: Vehicle | ||
|
@@ -436,9 +438,10 @@ obj2 = JSON3.read(""" | |
@test_throws ArgumentError JSON3.read!("{\"a\": 1, a", A(1, 2, 3, 4)) | ||
@test_throws ArgumentError JSON3.read!("}", A(1, 2, 3, 4)) | ||
|
||
@test_throws ArgumentError JSON3.read("{}", C) | ||
@test_throws ArgumentError JSON3.write(C()) | ||
@test JSON3.write(C()) == "\"C()\"" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
Wynand
Author
Contributor
|
||
@test JSON3.write(ParametricSingleton{Int64}()) == "\"ParametricSingleton{Int64}()\"" | ||
|
||
@test_throws MethodError JSON3.read("{}", C) | ||
StructTypes.StructType(::Type{C}) = StructTypes.Struct() | ||
|
||
@test JSON3.read("{}", C) == C() | ||
|
2 comments
on commit 3d542d3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Registration pull request created: JuliaRegistries/General/67936
After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.
This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:
git tag -a v1.10.0 -m "<description of version>" 3d542d32bc5d9fddce2feef7ce577db626e0195c
git push origin v1.10.0
@Wynand, sorry for the cold ping on an old commit. I'm going back over some of the behaviors of JSON3 and I can't quite remember why we changed to outputting singletons as strings instead of like an empty object. Could you walk me through the reasoning here? (that is, if you even remember yourself!)