File: helper_test.go

package info (click to toggle)
golang-github-goccy-go-json 0.10.5-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,928 kB
  • sloc: makefile: 36
file content (24 lines) | stat: -rw-r--r-- 526 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
23
24
package json_test

import "testing"

func assertErr(t *testing.T, err error) {
	t.Helper()
	if err != nil {
		t.Fatalf("%+v", err)
	}
}

func assertEq(t *testing.T, msg string, exp interface{}, act interface{}) {
	t.Helper()
	if exp != act {
		t.Fatalf("failed to test for %s. exp=[%v] but act=[%v]", msg, exp, act)
	}
}

func assertNeq(t *testing.T, msg string, exp interface{}, act interface{}) {
	t.Helper()
	if exp == act {
		t.Fatalf("failed to test for %s. expected value is not [%v] but got same value", msg, act)
	}
}