Skip to content
This repository has been archived by the owner on Apr 9, 2024. It is now read-only.

Use cmp in tests #188

Open
rbehjati opened this issue Dec 21, 2022 · 0 comments
Open

Use cmp in tests #188

rbehjati opened this issue Dec 21, 2022 · 0 comments
Labels
Core good first issue Good for newcomers

Comments

@rbehjati
Copy link
Contributor

A conventional pattern in tests is to use the cmp package and the following pattern:

if diff := cmp.Diff(got, want); diff != "" {
  t.Errorf("<descriptive error message referring to got and want>")

Ideally this should be followed in all tests and much as possible.

@rbehjati rbehjati added the good first issue Good for newcomers label Dec 21, 2022
@rbehjati rbehjati added the Core label Apr 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Core good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant