# Testing Graphics in a Testing Notebook

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?

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.

• +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}]].) – Michael E2 Feb 13 '18 at 16:41
• I wonder why it fails. CellChangeTimes? Or something silly like that? Imo a bug. – ktm Feb 13 '18 at 16:47

Digging around using FullForm[]shows that the difference is a string-valued private tag

ChartingPrivateTag$[random number]  Therefore, we may manually set that tag number to, say, 1 via a rule nullRule = x_String /; StringMatchQ[x, "ChartingPrivateTag$*"] ->
"ChartingPrivateTag\$1";
`

then the test runs okay: