update test to exit with the correct code