Testing Notebooks report the result of Plot
as a Failure, when in fact it should be a Success.
Is there a way to fix this?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityTesting Notebooks report the result of Plot
as a Failure, when in fact it should be a Success.
Is there a way to fix this?
This is a similar issue to Testing Grids in a Testing Notebook and has the same solution: add a {SameTest -> (Rasterize[#1] == Rasterize[#2] &)}
.
Seems related to the issue raised in Testing equality of graphics.
Rasterize[Plot[Sin[x] + 10^-5, {x, 0, 10}]] == Rasterize[Plot[Sin[x], {x, 0, 10}]]
.)
$\endgroup$
Feb 13, 2018 at 16:41
CellChangeTimes
? Or something silly like that? Imo a bug.
$\endgroup$
Digging around using FullForm[]
shows that the difference is a string-valued private tag
`Charting`Private`Tag$[random number]
Therefore, we may manually set that tag number to, say, 1 via a rule
nullRule = x_String /; StringMatchQ[x, "Charting`Private`Tag$*"] ->
"Charting`Private`Tag$1";
then the test runs okay: