gotestyourself / gotestyourself/gotest.tools
Improved error message when checks with variables fail
Open
enhancement
- Dominant language
- Go
- Stars
- 576
- Forks
- 54
- Avg merge
- 6d 3h
- Merged PRs (30d)
- 2
Description
I realise this would be difficult (or potentially impossible) to solve, but when an expression fails it would be very useful to have the value available.
eg.
The following test code:
```go
a := 1
assert.Check(t, a == 2)
```
Produces the error:
```
parser_test.go:20: assertion failed: expression is false: a == 2
```
This is not that helpful, as I now need to edit the code to print the actual value.
Ideally it would print something like:
```
parser_test.go:20: assertion failed: expression is false: a (1) == 2
```
Contributor guide
Assessment
This issue has not been assessed yet.