aboutsummaryrefslogtreecommitdiffstats
path: root/modules/optional/serialization_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/optional/serialization_test.go')
-rw-r--r--modules/optional/serialization_test.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/modules/optional/serialization_test.go b/modules/optional/serialization_test.go
index 09a4bddea0..cf81a94cfc 100644
--- a/modules/optional/serialization_test.go
+++ b/modules/optional/serialization_test.go
@@ -4,7 +4,7 @@
package optional_test
import (
- std_json "encoding/json" //nolint:depguard
+ std_json "encoding/json" //nolint:depguard // for testing purpose
"testing"
"code.gitea.io/gitea/modules/json"
@@ -51,11 +51,11 @@ func TestOptionalToJson(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
b, err := json.Marshal(tc.obj)
assert.NoError(t, err)
- assert.EqualValues(t, tc.want, string(b), "gitea json module returned unexpected")
+ assert.Equal(t, tc.want, string(b), "gitea json module returned unexpected")
b, err = std_json.Marshal(tc.obj)
assert.NoError(t, err)
- assert.EqualValues(t, tc.want, string(b), "std json module returned unexpected")
+ assert.Equal(t, tc.want, string(b), "std json module returned unexpected")
})
}
}
@@ -89,12 +89,12 @@ func TestOptionalFromJson(t *testing.T) {
var obj1 testSerializationStruct
err := json.Unmarshal([]byte(tc.data), &obj1)
assert.NoError(t, err)
- assert.EqualValues(t, tc.want, obj1, "gitea json module returned unexpected")
+ assert.Equal(t, tc.want, obj1, "gitea json module returned unexpected")
var obj2 testSerializationStruct
err = std_json.Unmarshal([]byte(tc.data), &obj2)
assert.NoError(t, err)
- assert.EqualValues(t, tc.want, obj2, "std json module returned unexpected")
+ assert.Equal(t, tc.want, obj2, "std json module returned unexpected")
})
}
}
@@ -135,7 +135,7 @@ optional_two_string: null
t.Run(tc.name, func(t *testing.T) {
b, err := yaml.Marshal(tc.obj)
assert.NoError(t, err)
- assert.EqualValues(t, tc.want, string(b), "yaml module returned unexpected")
+ assert.Equal(t, tc.want, string(b), "yaml module returned unexpected")
})
}
}
@@ -184,7 +184,7 @@ optional_twostring: null
var obj testSerializationStruct
err := yaml.Unmarshal([]byte(tc.data), &obj)
assert.NoError(t, err)
- assert.EqualValues(t, tc.want, obj, "yaml module returned unexpected")
+ assert.Equal(t, tc.want, obj, "yaml module returned unexpected")
})
}
}