Skip to content

Commit c62cf8c

Browse files
committed
Add a utility method for @testing that all default measures are < epsilon
1 parent e577f2c commit c62cf8c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/test/compare.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,14 @@ function (d::DefaultComparison)(c, names, b, t, n, r)
4444
:observed => SymbolicIndexingInterface.is_observed.(c, b)])
4545
end
4646

47+
function default_near_zero(result; ϵ=1e-7)
48+
obses = stack(result, 2:ncol(result)-1)
49+
for obs in eachrow(obses)
50+
@test obs[:value] < ϵ || "$(obs[:variable])($(obs[:var])) = $(obs[:value]) > ϵ = "
51+
end
52+
@show result
53+
end
54+
4755

4856
"""
4957
compare(

0 commit comments

Comments
 (0)