ARO-RP/vendor/github.com/go-test/deep
Ben Vesel 37d6378a88
Bump github.com/containers/podman/v4 from 4.1.1 to 4.4.2 (#3135)
Bumps [github.com/containers/podman/v4](https://github.com/containers/podman) from 4.1.1 to 4.4.2.
- [Release notes](https://github.com/containers/podman/releases)
- [Changelog](https://github.com/containers/podman/blob/main/RELEASE_NOTES.md)
- [Commits](https://github.com/containers/podman/compare/v4.1.1...v4.4.2)

---
updated-dependencies:
- dependency-name: github.com/containers/podman/v4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-31 18:59:01 -04:00
..
.gitignore move to go.mod, add deps.go, upgrade dependencies, vendor 2020-11-06 11:35:56 -06:00
CHANGES.md Bump github.com/containers/podman/v4 from 4.1.1 to 4.4.2 (#3135) 2023-08-31 18:59:01 -04:00
LICENSE add go-test/deep as a dependency 2020-09-16 14:03:25 +10:00
README.md Bump github.com/containers/podman/v4 from 4.1.1 to 4.4.2 (#3135) 2023-08-31 18:59:01 -04:00
SECURITY.md Automated updates from "make vendor" 2022-01-25 11:47:15 -05:00
deep.go Bump github.com/containers/podman/v4 from 4.1.1 to 4.4.2 (#3135) 2023-08-31 18:59:01 -04:00

README.md

Deep Variable Equality for Humans

Go Report Card Coverage Status Go Reference

This package provides a single function: deep.Equal. It's like reflect.DeepEqual but much friendlier to humans (or any sentient being) for two reason:

  • deep.Equal returns a list of differences
  • deep.Equal does not compare unexported fields (by default)

reflect.DeepEqual is good (like all things Golang!), but it's a game of Hunt the Wumpus. For large maps, slices, and structs, finding the difference is difficult.

deep.Equal doesn't play games with you, it lists the differences:

package main_test

import (
	"testing"
	"github.com/go-test/deep"
)

type T struct {
	Name    string
	Numbers []float64
}

func TestDeepEqual(t *testing.T) {
	// Can you spot the difference?
	t1 := T{
		Name:    "Isabella",
		Numbers: []float64{1.13459, 2.29343, 3.010100010},
	}
	t2 := T{
		Name:    "Isabella",
		Numbers: []float64{1.13459, 2.29843, 3.010100010},
	}

	if diff := deep.Equal(t1, t2); diff != nil {
		t.Error(diff)
	}
}
$ go test
--- FAIL: TestDeepEqual (0.00s)
        main_test.go:25: [Numbers.slice[1]: 2.29343 != 2.29843]

The difference is in Numbers.slice[1]: the two values aren't equal using Go ==.