Add test testExitAfterPrint