generalize the no_flip test a bit