add test for an optimization about scan sequences