Improve failure messages in `tests/util.rs`

- Previous error messages were a bit confusing, so now they are
pattern matched and the correct error is displayed via `fail!`