macro test_expression(expr)
    esc(quote
            @test JuMP.isequal_canonical(@expression(m, $expr), $expr)
    end)
end

macro test_expression_with_string(expr, str)
    esc(quote
            @test string(@inferred $expr) == $str
            @test_expression $expr
    end)
end

# Test that the macro call `m` throws an error exception during pre-compilation
macro test_macro_throws(errortype, m)
    # See https://discourse.julialang.org/t/test-throws-with-macros-after-pr-23533/5878
    :(@test_throws $errortype try @eval $m catch err; throw(err.error) end)
end

# Define test data structures
struct BadSet <: AbstractInfiniteSet end
struct TestBridge{C} <: MOI.Bridges.AbstractBridge where {C} end
struct BadData <: AbstractMeasureData end
struct Bad end
struct NotASetType end

# Define test functions
function new_fn end
