|
1 | | -using Test |
2 | | -using JSON |
3 | | -using JSONRPC |
4 | | -using JSONRPC: typed_res, @dict_readable, Outbound |
5 | | -using Sockets |
| 1 | +using TestItemRunner |
6 | 2 |
|
7 | | -@dict_readable struct Foo <: Outbound |
8 | | - fieldA::Int |
9 | | - fieldB::String |
10 | | - fieldC::Union{Missing,String} |
11 | | - fieldD::Union{String,Missing} |
12 | | -end |
13 | | - |
14 | | -@dict_readable struct Foo2 <: Outbound |
15 | | - fieldA::Union{Nothing,Int} |
16 | | - fieldB::Vector{Int} |
17 | | -end |
18 | | - |
19 | | -Base.:(==)(a::Foo2,b::Foo2) = a.fieldA == b.fieldA && a.fieldB == b.fieldB |
20 | | - |
21 | | -@testset "JSONRPC" begin |
22 | | - include("test_core.jl") |
23 | | - include("test_interface_def.jl") |
24 | | - include("test_typed.jl") |
25 | | - |
26 | | - @testset "check response type" begin |
27 | | - @test typed_res(nothing, Nothing) isa Nothing |
28 | | - @test typed_res([1,"2",3], Vector{Any}) isa Vector{Any} |
29 | | - @test typed_res([1,2,3], Vector{Int}) isa Vector{Int} |
30 | | - @test typed_res([1,2,3], Vector{Float64}) isa Vector{Float64} |
31 | | - @test typed_res(['f','o','o'], String) isa String |
32 | | - @test typed_res("foo", String) isa String |
33 | | - end |
34 | | -end |
| 3 | +@run_package_tests |
0 commit comments