From 6f70a7237b77ad75a3adcf2dd30bbf75376451a5 Mon Sep 17 00:00:00 2001 From: Julien Dessaux Date: Wed, 22 Sep 2021 23:42:16 +0200 Subject: Fixed test order mistake between expected value and got value --- pkg/field/error_test.go | 2 +- pkg/field/utils_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'pkg/field') diff --git a/pkg/field/error_test.go b/pkg/field/error_test.go index 45e8f83..e87083e 100644 --- a/pkg/field/error_test.go +++ b/pkg/field/error_test.go @@ -8,7 +8,7 @@ import ( ) func requireErrorTypeMatch(t *testing.T, err error, expected error) { - require.Equalf(t, reflect.TypeOf(err), reflect.TypeOf(expected), "Invalid error type. Got %s but expected %s", reflect.TypeOf(err), reflect.TypeOf(expected)) + require.Equalf(t, reflect.TypeOf(expected), reflect.TypeOf(err), "Invalid error type. Got %s but expected %s", reflect.TypeOf(err), reflect.TypeOf(expected)) } func TestErrorsCoverage(t *testing.T) { diff --git a/pkg/field/utils_test.go b/pkg/field/utils_test.go index 59a7cee..9c1f7c7 100644 --- a/pkg/field/utils_test.go +++ b/pkg/field/utils_test.go @@ -319,13 +319,13 @@ func TestGetAndSetOnEmptyLines(t *testing.T) { field, err := Load(file) field.Set(0, 3, '#') v := field.Get(0, 3) - require.Equal(t, v, int('#')) + require.Equal(t, int('#'), v) v = field.Get(0, 2) - require.Equal(t, v, int(' ')) + require.Equal(t, int(' '), v) field.Set(0, 2, 'a') field.Set(0, -4, 'b') v = field.Get(0, -1) - require.Equal(t, v, int(' ')) + require.Equal(t, int(' '), v) field.Set(0, -1, 'c') - require.Equal(t, field, &f) + require.Equal(t, &f, field) } -- cgit v1.2.3