diff --git a/encode_test.go b/encode_test.go index 54225e9..a2d6950 100644 --- a/encode_test.go +++ b/encode_test.go @@ -6,20 +6,6 @@ import ( "github.com/goccy/go-json" ) -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 encode %s. exp=[%v] but act=[%v]", msg, exp, act) - } -} - func Test_Encoder(t *testing.T) { t.Run("int", func(t *testing.T) { bytes, err := json.Marshal(-10) diff --git a/helper_test.go b/helper_test.go new file mode 100644 index 0000000..26c0f12 --- /dev/null +++ b/helper_test.go @@ -0,0 +1,17 @@ +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) + } +}