Test of gauge invariance reconsidered