Bläddra i källkod

Improve errors code coverage (#944)

Eason Lin 8 år sedan
förälder
incheckning
9ff8786b3d
1 ändrade filer med 7 tillägg och 0 borttagningar
  1. 7 0
      errors_test.go

+ 7 - 0
errors_test.go

@@ -54,6 +54,13 @@ func TestError(t *testing.T) {
 		"status": "200",
 		"data":   "some data",
 	})
+
+	type customError struct {
+		status string
+		data   string
+	}
+	err.SetMeta(customError{status: "200", data: "other data"})
+	assert.Equal(t, err.JSON(), customError{status: "200", data: "other data"})
 }
 
 func TestErrorSlice(t *testing.T) {