Skip to content

Commit 1448ac7

Browse files
committed
Add test
1 parent 61f6766 commit 1448ac7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/subs.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ end
138138

139139
function _mono_eval(z::Vector{Int}, vals::AbstractVector)
140140
if length(z) != length(vals)
141-
error("")
141+
error("Cannot evaluate a polynomial of `$(length(z))` variables with only `$(length(vals))` values.")
142142
end
143143
if isempty(z)
144144
return one(eltype(vals))^1

test/runtests.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ end
1818
alloc_test_lt(() -> p(x => v), 300)
1919
alloc_test_lt(() -> substitute(Eval(), p, v), 0)
2020
alloc_test_lt(() -> p(v), 0)
21+
err = ErrorException("Cannot evaluate a polynomial of `3` variables with only `2` values.")
22+
@test_throws err p([1, 2])
2123
end
2224

2325
@testset "Issue #70" begin

0 commit comments

Comments
 (0)