Skip to content

Commit

Permalink
revert tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubwro committed Oct 4, 2023
1 parent b0073b3 commit 3306c1d
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions test/connection.jl
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,28 @@ end
@testset "Method error hints." begin
nc = NATS.connect()

hint = """To use `Type{Float64}` as parameter of subscription handler apropriate conversion from `Type{NATS.Msg}` must be provided.
```
import Base: convert
# hint = """To use `Type{Float64}` as parameter of subscription handler apropriate conversion from `Type{NATS.Msg}` must be provided.
# ```
# import Base: convert

function convert(::Type{Type{Float64}}, msg::Union{NATS.Msg, NATS.HMsg})
# Implement conversion logic here.
end
"""
@test_throws hint subscribe("SOME.THING") do msg::Float64
# function convert(::Type{Type{Float64}}, msg::Union{NATS.Msg, NATS.HMsg})
# # Implement conversion logic here.
# end
# """
@test_throws MethodError subscribe("SOME.THING") do msg::Float64
put!(c, msg)
end
@test_throws MethodError request("SOME.REQUESTS"; payload = 4)
hint = """Object of type `Int64` cannot be serialized into payload."""
@test_throws hint request("SOME.REQUESTS", 4) # TODO: in this case there should be rather warning about missing payload.
hint = """To use `Type{Integer}` as parameter of subscription handler apropriate conversion from `Type{NATS.Msg}` must be provided.
```
import Base: convert
# hint = """Object of type `Int64` cannot be serialized into payload."""
@test_throws MethodError request("SOME.REQUESTS", 4) # TODO: in this case there should be rather warning about missing payload.
# hint = """To use `Type{Integer}` as parameter of subscription handler apropriate conversion from `Type{NATS.Msg}` must be provided.
# ```
# import Base: convert

function convert(::Type{Type{Integer}}, msg::Union{NATS.Msg, NATS.HMsg})
# Implement conversion logic here.
end
"""
# function convert(::Type{Type{Integer}}, msg::Union{NATS.Msg, NATS.HMsg})
# # Implement conversion logic here.
# end
# """
@test_throws MethodError reply("SOME.REQUESTS") do msg::Integer
"Received $msg"
end
Expand Down

0 comments on commit 3306c1d

Please sign in to comment.