diff --git a/src/subs.jl b/src/subs.jl index 7bdac8e..03501d5 100644 --- a/src/subs.jl +++ b/src/subs.jl @@ -138,7 +138,7 @@ end function _mono_eval(z::Vector{Int}, vals::AbstractVector) if length(z) != length(vals) - error("") + error("Cannot evaluate a polynomial of `$(length(z))` variables with only `$(length(vals))` values.") end if isempty(z) return one(eltype(vals))^1 diff --git a/test/runtests.jl b/test/runtests.jl index c9f1a49..ac0c6e0 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -18,6 +18,8 @@ end alloc_test_lt(() -> p(x => v), 300) alloc_test_lt(() -> substitute(Eval(), p, v), 0) alloc_test_lt(() -> p(v), 0) + err = ErrorException("Cannot evaluate a polynomial of `3` variables with only `2` values.") + @test_throws err p([1, 2]) end @testset "Issue #70" begin