@@ -46,10 +46,6 @@ import JSON3
4646 @test occursin (" │ short_var = a" , str)
4747end
4848
49- struct NoStructTypeDefined
50- f:: Int
51- end
52-
5349@testset " JSON" begin
5450 @test LoggingFormats. lvlstr (Logging. Error + 1 ) == " error"
5551 @test LoggingFormats. lvlstr (Logging. Error) == " error"
116112 io = IOBuffer ()
117113 with_logger (FormatLogger (JSON (; recursive= true ), io)) do
118114 y = (1 , 2 )
119- @info " info msg" x = [1 , 2 , 3 ] y = Dict (" hi" => NoStructTypeDefined ( 1 ) )
115+ @info " info msg" x = [1 , 2 , 3 ] y = Dict (" hi" => NaN )
120116 end
121117 json = JSON3. read (seekstart (io))
122118 @test json. level == " info"
125121 @test json. line isa Int
126122 @test json. kwargs. x == " [1, 2, 3]"
127123 y = json. kwargs. y
128- must_have = (" Dict" , " \" hi\" " , " =>" , " NoStructTypeDefined(1) " )
124+ must_have = (" Dict" , " \" hi\" " , " =>" , " NaN " )
129125 @test all (h -> occursin (h, y), must_have) # avoid issues with printing changing with versions
130- @test json. kwargs[Symbol (" LoggingFormats.FormatError" )] == " ArgumentError: NoStructTypeDefined doesn't have a defined `StructTypes.StructType` "
126+ @test json. kwargs[Symbol (" LoggingFormats.FormatError" )] == " NaN not allowed to be written in JSON spec "
131127
132128 # Test logging exceptions
133129 for recursive in (false , true )
0 commit comments