Skip to content

Commit

Permalink
test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Jun 8, 2024
1 parent d9303ad commit 10dc143
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions test/unittests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -956,9 +956,13 @@ end
abstract type FakeModule end
struct FakeModule1 <: FakeModule end
struct FakeModule2 <: FakeModule end
struct FakeModule3 <: FakeModule end
struct FakeUUID1 <: FakeUUID end
struct FakeUUID2 <: FakeUUID end
struct FakeUUID3 <: FakeUUID end

# Default:
@test DDP.uuid_type(Core.Main) == Base.UUID
DDP.uuid_type(::FakeModule) = FakeUUID
get_uuid(::FakeModule1) = FakeUUID1()
get_uuid(::FakeModule2) = FakeUUID2()
Expand Down Expand Up @@ -986,6 +990,12 @@ end
m2 = FakeModule2()
has_preference(::FakeUUID2, k) = k != "instability_check_codegen_level"
@test DDP.get_all_preferred(options, m2) == DDP.StabilizationOptions("a", "b", 7)

# FakeModule3 takes the defaults for everything:
m3 = FakeModule3()
has_preference(::FakeUUID3, k) = false
options = DDP.StabilizationOptions("f", "g", 8)
@test DDP.get_all_preferred(options, m3) == options
end
@testitem "warn on no matches" begin
using DispatchDoctor
Expand Down

0 comments on commit 10dc143

Please sign in to comment.