File: assert.go

package info (click to toggle)
golang-github-editorconfig-editorconfig-core-go 2.6.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 220 kB
  • sloc: makefile: 32
file content (22 lines) | stat: -rw-r--r-- 293 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
package assert

import (
	"testing"

	"github.com/google/go-cmp/cmp"
)

func Equal(t *testing.T, x, y interface{}) {
	t.Helper()

	r := DiffReporter{}
	if !cmp.Equal(x, y, cmp.Reporter(&r)) {
		t.Error(r.String())
	}
}

func Nil(t *testing.T, x interface{}) {
	t.Helper()

	Equal(t, x, nil)
}