tests: Refine the repl function.