Skip to content

Commit

Permalink
Try to fix continuous integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobjpeters committed Aug 6, 2024
1 parent 2d75a2f commit c6b787d
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions test/unittests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1233,30 +1233,28 @@ end
end
@testitem "Macros with same name" begin
using DispatchDoctor: _Interactions as DDI
@register_macro IncompatibleMacro @new_macro

module AModule
using DispatchDoctor
@register_macro CompatibleMacro @stable
@register_macro CompatibleMacro @new_macro
module BModule end
end

module CModule
module DModule
using DispatchDoctor
@register_macro DontPropagateMacro @stable
@register_macro DontPropagateMacro @new_macro
end
end

@test DDI.get_macro_behavior(Main, Symbol("@stable")) == DDI.IncompatibleMacro
@test DDI.get_macro_behavior(AModule, Symbol("@stable")) == DDI.CompatibleMacro
@test DDI.get_macro_behavior(AModule.BModule, Symbol("@stable")) == DDI.CompatibleMacro
@test DDI.get_macro_behavior(CModule, Symbol("@stable")) == DDI.IncompatibleMacro
@test DDI.get_macro_behavior(CModule.DModule, Symbol("@stable")) == DDI.DontPropagateMacro
@test DDI.get_macro_behavior(@__MODULE__, Symbol("@new_macro")) == DDI.IncompatibleMacro
@test DDI.get_macro_behavior(AModule, Symbol("@new_macro")) == DDI.CompatibleMacro
@test DDI.get_macro_behavior(AModule.BModule, Symbol("@new_macro")) == DDI.CompatibleMacro
@test DDI.get_macro_behavior(CModule, Symbol("@new_macro")) == DDI.IncompatibleMacro
@test DDI.get_macro_behavior(CModule.DModule, Symbol("@new_macro")) == DDI.DontPropagateMacro

@test_throws LoadError eval(quote
@register_macro CompatibleMacro @a_macro
@register_macro IncompatibleMacro @a_macro
end)
@test_throws LoadError eval(:(@register_macro CompatibleMacro @new_macro))
end

@run_package_tests

0 comments on commit c6b787d

Please sign in to comment.