Skip to content

Commit

Permalink
fix #23
Browse files Browse the repository at this point in the history
  • Loading branch information
zsunberg committed Mar 15, 2021
1 parent 58f98d2 commit a6c5b56
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/quick.jl
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ function quick_warnings(kwd)
if haskey(kwd, :initialstate)
isd = _call(Val(:initialstate), kwd[:initialstate], ())
try rand(MersenneTwister(0), isd)
catch
if ex isa MethodError
catch ex
if ex isa MethodError || ex isa ArgumentError
@warn("Unable to call rand(rng, $isd). Is the `initialstate` that you supplied a distribution?")
else
rethrow(ex)
Expand Down
4 changes: 4 additions & 0 deletions test/quick.jl
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,7 @@ end
@test rand(@inferred(observation(m, 2, 3))) == 3
@test rand(@inferred(observation(m, 1, 2, 3))) == 3
end

@testset "#23" begin
@test_throws ArgumentError QuickPOMDP(initialstate=:test)
end

0 comments on commit a6c5b56

Please sign in to comment.