6
$\begingroup$

Testing Notebooks report the result of Plot as a Failure, when in fact it should be a Success.

enter image description here

Is there a way to fix this?

$\endgroup$
3
$\begingroup$

This is a similar issue to Testing Grids in a Testing Notebook and has the same solution: add a {SameTest -> (Rasterize[#1] == Rasterize[#2] &)}.

enter image description here

Seems related to the issue raised in Testing equality of graphics.

$\endgroup$
  • 1
    $\begingroup$ +1. It does seem inconvenient to have to do this. (Note that rasterizing on tests approximate equality only. E.g. Rasterize[Plot[Sin[x] + 10^-5, {x, 0, 10}]] == Rasterize[Plot[Sin[x], {x, 0, 10}]].) $\endgroup$ – Michael E2 Feb 13 '18 at 16:41
  • $\begingroup$ I wonder why it fails. CellChangeTimes? Or something silly like that? Imo a bug. $\endgroup$ – user6014 Feb 13 '18 at 16:47
3
$\begingroup$

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:

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.