added a string rewriting test for gen.stateful