* impr: `CallerInfo` should print full paths to the terminal
I am proposing this simple change, which changes this output
```
--- FAIL: TestABC (0.00s)
--- FAIL: TestABC/C (0.00s)
/this/is/a/path/to/file_test.go:258:
Error Trace: file_test.go:258
file_test.go:748
Error: Not equal:
...
```
to this:
```
--- FAIL: TestABC (0.00s)
--- FAIL: TestABC/C (0.00s)
/this/is/a/path/to/file_test.go:258:
Error Trace: /this/is/a/path/to/file_test.go:258
/this/is/a/path/to/file_test.go:748
Error: Not equal:
...
```
With the latter output, it is much more straightforward to find the file
you are looking for, even though in the displayed case, the file is the same.
However, for VSCodium, the case is a little more helpful, since VSCodium's
terminal is smart enough to recognize the output, and make links out of that input.
Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
* test: fix the tests that depended on the previous behavior
Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
Co-authored-by: Stavros Ntentos <11300730-stavros-relex@users.noreply.gitlab.com>
* Add WithinTimeRange method
* Run ./.ci.generate.sh
* Rename WithinTimeRange to WithinRange
* Rename WithinRange expected parameter to actual
* Capitalise start parameter at start of error message
* Improve WithinRange example
Previously, the function would not detect panic(nil) calls.
In didPanic, removed the anonymous function call, instead,
added named return values. Added extra test cases for the
panic(nil) call.
The latest update to golang/protobuf (I am on v1.4.2) break the spew circular data structure detection. This means that when calling `assert.Equal(t, proto1, proto2)` will not only fail, but also enter an infinite recursion.
Given spew is not being actively maintained, and tesitfy should set some upper bound, we need to set a `MaxDepth` to some very high number, so at least the test will not run for a very long time and finish and fail quickly.
Prior to this commit, this would not work:
```go
type myInt int
assert.Less(t, myInt(1), myInt(2)) // panic!
```
We add some type conversions, similarly to how `ObjectsAreEqualValues`
work. This allows us to compare `myInt` to `myInt`, as well as `myInt`
to `int`.