test simple state loop