move termination expression with local vars to separate test