File tree Expand file tree Collapse file tree 3 files changed +21
-17
lines changed
Expand file tree Collapse file tree 3 files changed +21
-17
lines changed Original file line number Diff line number Diff line change 1- using JSONRPC: @dict_readable , Outbound
1+ @testmodule TestStructs begin
2+ using JSONRPC: @dict_readable , Outbound
23
3- @dict_readable struct Foo <: Outbound
4- fieldA:: Int
5- fieldB:: String
6- fieldC:: Union{Missing,String}
7- fieldD:: Union{String,Missing}
8- end
4+ export Foo, Foo2
95
10- @dict_readable struct Foo2 <: Outbound
11- fieldA:: Union{Nothing,Int}
12- fieldB:: Vector{Int}
13- end
6+ @dict_readable struct Foo <: Outbound
7+ fieldA:: Int
8+ fieldB:: String
9+ fieldC:: Union{Missing,String}
10+ fieldD:: Union{String,Missing}
11+ end
12+
13+ @dict_readable struct Foo2 <: Outbound
14+ fieldA:: Union{Nothing,Int}
15+ fieldB:: Vector{Int}
16+ end
1417
15- Base.:(== )(a:: Foo2 ,b:: Foo2 ) = a. fieldA == b. fieldA && a. fieldB == b. fieldB
18+ Base.:(== )(a:: Foo2 ,b:: Foo2 ) = a. fieldA == b. fieldA && a. fieldB == b. fieldB
19+
20+ end
Original file line number Diff line number Diff line change 1- @testitem " Interface Definition" begin
1+ @testitem " Interface Definition" setup = [TestStructs] begin
22 using JSON
3- include ( " shared_test_code.jl " )
3+ using . TestStructs : Foo, Foo2
44
55 @test_throws ErrorException Foo ()
66
Original file line number Diff line number Diff line change 1- @testitem " Message dispatcher" begin
1+ @testitem " Dynamic message dispatcher" setup = [TestStructs] begin
22 using Sockets
3-
4- include (" shared_test_code.jl" )
3+ using . TestStructs: Foo, Foo2
54
65 if Sys. iswindows ()
76 global_socket_name1 = " \\\\ .\\ pipe\\ jsonrpc-testrun1"
You can’t perform that action at this time.
0 commit comments