Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add Compare #547

Merged
merged 2 commits into from Apr 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions index.md
Expand Up @@ -518,6 +518,17 @@ When both `ACTUAL` and `EXPECTED` are a very long strings, it will attempt to pr

> For asserting equality between numbers of different types, you'll want to use the [`BeNumerically()`](#benumericallycomparator-string-compareto-interface) matcher.

#### BeComparableTo(expected interface{}, ...opts cmp.Option)

uses go-cmp cmp.Equal to compare `ACTUAL` with `EXPECTED`.

```go
Ω(ACTUAL).Should(BeComparableTo(EXPECTED))
Ω(ACTUAL).Should(BeComparableTo(EXPECTED), cmpopts.EquateApproxTime(time.Millisecond))
```

You can pass cmp.Option as options ,See the [go-cmp documentation](https://github.com/google/go-cmp) for more option information

#### BeEquivalentTo(expected interface{})

```go
Expand Down