Skip to content

Commit 8f7f425

Browse files
committed
document MatchErrorStrictly
1 parent bae643d commit 8f7f425

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

docs/index.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,14 @@ succeeds if `ACTUAL` is a non-nil `error` that matches `EXPECTED`. `EXPECTED` mu
878878

879879
Any other type for `EXPECTED` is an error. It is also an error for `ACTUAL` to be nil. Note that `FUNCTION_ERROR_DESCRIPTION` is a description of the error function, if used. This is required when passing a function but is ignored in all other cases.
880880

881+
#### MatchErrorStrictly(expected any)
882+
883+
```go
884+
Ω(ACTUAL).Should(MatchErrorSTrictly(EXEPCTED))
885+
```
886+
887+
succeeds if and only if `ACTUAL` and `EXPECTED` are non-nil and `errors.Is(ACTUAL, EXPECTED)` returns `true`. This is stricter than `MatchError` which will fall back on string comparison.
888+
881889
### Working with Channels
882890

883891
#### BeClosed()

0 commit comments

Comments
 (0)