Add tests for handling exit codes.