-
Notifications
You must be signed in to change notification settings - Fork 99
/
runtests.jl
80 lines (64 loc) · 1.77 KB
/
runtests.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
using JSON
using Test
using Dates
using Distributed: RemoteChannel
using OffsetArrays
import DataStructures
include("json-samples.jl")
@testset "Parser" begin
@testset "Parser Failures" begin
include("parser/invalid-input.jl")
end
@testset "parsefile" begin
include("parser/parsefile.jl")
end
@testset "dicttype" begin
include("parser/dicttype.jl")
end
@testset "inttype" begin
include("parser/inttype.jl")
end
@testset "Miscellaneous" begin
# test for single values
@test JSON.parse("true") == true
@test JSON.parse("null") == nothing
@test JSON.parse("\"hello\"") == "hello"
@test JSON.parse("\"a\"") == "a"
@test JSON.parse("1") == 1
@test JSON.parse("1.5") == 1.5
@test JSON.parse("[true]") == [true]
end
end
@testset "Serializer" begin
@testset "Standard Serializer" begin
include("standard-serializer.jl")
end
@testset "Lowering" begin
include("lowering.jl")
end
@testset "Custom Serializer" begin
include("serializer.jl")
end
end
@testset "Integration" begin
# ::Nothing values should be encoded as null
testDict = Dict("a" => nothing)
nothingJson = JSON.json(testDict)
nothingDict = JSON.parse(nothingJson)
@test testDict == nothingDict
@testset "async" begin
include("async.jl")
end
@testset "indentation" begin
include("indentation.jl")
end
@testset "JSON Checker" begin
include("json-checker.jl")
end
end
@testset "Regression" begin
@testset "for issue #$i" for i in [21, 26, 57, 109, 152, 163]
include("regression/issue$(lpad(string(i), 3, "0")).jl")
end
end
# Check that printing to the default stdout doesn't fail