Wouldn't the exit code returned by test() always return 0 in case of an error since the last command ...
stackoverflow.com