Skip to content

Commit 6add1ba

Browse files
committed
fix kataras#2158 and more
1 parent 757e7fe commit 6add1ba

File tree

79 files changed

+547
-463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+547
-463
lines changed

_examples/auth/basicauth/basic/main_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ func TestBasicAuth(t *testing.T) {
1717

1818
// with valid basic auth
1919
e.GET("/admin").WithBasicAuth("myusername", "mypassword").Expect().
20-
Status(httptest.StatusOK).Body().Equal("/admin myusername:mypassword")
20+
Status(httptest.StatusOK).Body().IsEqual("/admin myusername:mypassword")
2121
e.GET("/admin/profile").WithBasicAuth("myusername", "mypassword").Expect().
22-
Status(httptest.StatusOK).Body().Equal("/admin/profile myusername:mypassword")
22+
Status(httptest.StatusOK).Body().IsEqual("/admin/profile myusername:mypassword")
2323
e.GET("/admin/settings").WithBasicAuth("myusername", "mypassword").Expect().
24-
Status(httptest.StatusOK).Body().Equal("/admin/settings myusername:mypassword")
24+
Status(httptest.StatusOK).Body().IsEqual("/admin/settings myusername:mypassword")
2525

2626
// with invalid basic auth
2727
e.GET("/admin/settings").WithBasicAuth("invalidusername", "invalidpassword").

_examples/bootstrapper/main_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ func TestApp(t *testing.T) {
1414
// test our routes
1515
e.GET("/").Expect().Status(httptest.StatusOK)
1616
e.GET("/follower/42").Expect().Status(httptest.StatusOK).
17-
Body().Equal("from /follower/{id:int64} with ID: 42")
17+
Body().IsEqual("from /follower/{id:int64} with ID: 42")
1818
e.GET("/following/52").Expect().Status(httptest.StatusOK).
19-
Body().Equal("from /following/{id:int64} with ID: 52")
19+
Body().IsEqual("from /following/{id:int64} with ID: 52")
2020
e.GET("/like/64").Expect().Status(httptest.StatusOK).
21-
Body().Equal("from /like/{id:int64} with ID: 64")
21+
Body().IsEqual("from /like/{id:int64} with ID: 64")
2222

2323
// test not found
2424
e.GET("/notfound").Expect().Status(httptest.StatusNotFound)
@@ -28,5 +28,5 @@ func TestApp(t *testing.T) {
2828
"message": "",
2929
}
3030
e.GET("/anotfoundwithjson").WithQuery("json", nil).
31-
Expect().Status(httptest.StatusNotFound).JSON().Equal(expectedErr)
31+
Expect().Status(httptest.StatusNotFound).JSON().IsEqual(expectedErr)
3232
}

_examples/cookies/basic/main_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ func TestCookiesBasic(t *testing.T) {
2020

2121
// Test retrieve a Cookie.
2222
t2 := e.GET(fmt.Sprintf("/cookies/%s", cookieName)).Expect().Status(httptest.StatusOK)
23-
t2.Body().Equal(cookieValue)
23+
t2.Body().IsEqual(cookieValue)
2424

2525
// Test remove a Cookie.
2626
t3 := e.DELETE(fmt.Sprintf("/cookies/%s", cookieName)).Expect().Status(httptest.StatusOK)
2727
t3.Body().Contains(cookieName)
2828

2929
t4 := e.GET(fmt.Sprintf("/cookies/%s", cookieName)).Expect().Status(httptest.StatusOK)
3030
t4.Cookies().Empty()
31-
t4.Body().Empty()
31+
t4.Body().IsEmpty()
3232
}

_examples/cookies/options/main_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ func TestCookieOptions(t *testing.T) {
2020

2121
// Test retrieve a Cookie.
2222
t2 := e.GET(fmt.Sprintf("/get/%s", cookieName)).Expect().Status(httptest.StatusOK)
23-
t2.Body().Equal(cookieValue)
23+
t2.Body().IsEqual(cookieValue)
2424

2525
// Test remove a Cookie.
2626
t3 := e.GET(fmt.Sprintf("/remove/%s", cookieName)).Expect().Status(httptest.StatusOK)
2727
t3.Body().Contains(fmt.Sprintf("cookie %s removed, value should be empty=%s", cookieName, ""))
2828

2929
t4 := e.GET(fmt.Sprintf("/get/%s", cookieName)).Expect().Status(httptest.StatusOK)
3030
t4.Cookies().Empty()
31-
t4.Body().Empty()
31+
t4.Body().IsEmpty()
3232
}

_examples/cookies/securecookie/main_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ func TestSecureCookie(t *testing.T) {
2222

2323
// Test retrieve a Cookie.
2424
t2 := e.GET(fmt.Sprintf("/cookies/%s", cookieName)).Expect().Status(httptest.StatusOK)
25-
t2.Body().Equal(cookieValue)
25+
t2.Body().IsEqual(cookieValue)
2626

2727
// Test remove a Cookie.
2828
t3 := e.GET(fmt.Sprintf("/cookies/remove/%s", cookieName)).Expect().Status(httptest.StatusOK)
2929
t3.Body().Contains(cookieName)
3030

3131
t4 := e.GET(fmt.Sprintf("/cookies/%s", cookieName)).Expect().Status(httptest.StatusOK)
3232
t4.Cookies().Empty()
33-
t4.Body().Empty()
33+
t4.Body().IsEmpty()
3434
}

_examples/dependency-injection/basic/middleware/main_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ func TestDependencyInjectionBasic_Middleware(t *testing.T) {
1212
e := httptest.New(t, app)
1313
e.POST("/42").WithJSON(testInput{Email: "my_email"}).Expect().
1414
Status(httptest.StatusOK).
15-
JSON().Equal(testOutput{ID: 42, Name: "my_email"})
15+
JSON().IsEqual(testOutput{ID: 42, Name: "my_email"})
1616

1717
// it should stop the execution at the middleware and return the middleware's status code,
1818
// because the error is `ErrStopExecution`.
1919
e.POST("/42").WithJSON(testInput{Email: "invalid"}).Expect().
20-
Status(httptest.StatusAccepted).Body().Empty()
20+
Status(httptest.StatusAccepted).Body().IsEmpty()
2121

2222
// it should stop the execution at the middleware and return the error's text.
2323
e.POST("/42").WithJSON(testInput{Email: "error"}).Expect().
24-
Status(httptest.StatusConflict).Body().Equal("my_error")
24+
Status(httptest.StatusConflict).Body().IsEqual("my_error")
2525
}

_examples/file-server/basic/main_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ func TestFileServerBasic(t *testing.T) {
8989
e.GET(url).Expect().
9090
Status(httptest.StatusOK).
9191
ContentType(u.contentType(), app.ConfigurationReadOnly().GetCharset()).
92-
Body().Equal(contents)
92+
Body().IsEqual(contents)
9393
}
9494
}
9595

@@ -109,6 +109,6 @@ func TestHandleDirDot(t *testing.T) {
109109
e.GET(url).Expect().
110110
Status(httptest.StatusOK).
111111
ContentType(u.contentType(), app.ConfigurationReadOnly().GetCharset()).
112-
Body().Equal(contents)
112+
Body().IsEqual(contents)
113113
}
114114
}

_examples/file-server/embedding-files-into-app-bindata/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,6 @@ func TestEmbeddingFilesIntoApp(t *testing.T) {
8989
e.GET(url).Expect().
9090
Status(httptest.StatusOK).
9191
ContentType(u.contentType()).
92-
Body().Equal(contents)
92+
Body().IsEqual(contents)
9393
}
9494
}

_examples/file-server/embedding-files-into-app/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,6 @@ func TestEmbeddingFilesIntoApp(t *testing.T) {
8484
e.GET(url).Expect().
8585
Status(httptest.StatusOK).
8686
ContentType(u.contentType()).
87-
Body().Equal(contents)
87+
Body().IsEqual(contents)
8888
}
8989
}

_examples/file-server/single-page-application/embedded-single-page-application/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ func TestSPAEmbedded(t *testing.T) {
7777
e.GET(url).Expect().
7878
Status(httptest.StatusOK).
7979
ContentType(u.contentType(), app.ConfigurationReadOnly().GetCharset()).
80-
Body().Equal(contents)
80+
Body().IsEqual(contents)
8181
}
8282

8383
e.GET("/index.html").Expect().Status(httptest.StatusNotFound) // only root is served.

_examples/file-server/subdomain/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,6 @@ func TestFileServerSubdomainBasic(t *testing.T) {
7676
e.GET(url).WithURL(host).Expect().
7777
Status(httptest.StatusOK).
7878
ContentType(u.contentType(), app.ConfigurationReadOnly().GetCharset()).
79-
Body().Equal(contents)
79+
Body().IsEqual(contents)
8080
}
8181
}

_examples/i18n/basic/main_test.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -40,49 +40,49 @@ func TestI18n(t *testing.T) {
4040

4141
e := httptest.New(t, app)
4242
// default should be en-US.
43-
e.GET("/").Expect().Status(httptest.StatusOK).Body().Equal(tests["en-US"])
43+
e.GET("/").Expect().Status(httptest.StatusOK).Body().IsEqual(tests["en-US"])
4444

4545
for lang, body := range tests {
4646
e.GET("/").WithQueryString("lang=" + lang).Expect().Status(httptest.StatusOK).
47-
Body().Equal(body)
47+
Body().IsEqual(body)
4848

4949
// test lowercase.
5050
e.GET("/").WithQueryString("lang=" + strings.ToLower(lang)).Expect().Status(httptest.StatusOK).
51-
Body().Equal(body)
51+
Body().IsEqual(body)
5252

5353
// test first part (e.g. en instead of en-US).
5454
langFirstPart := strings.Split(lang, "-")[0]
5555
e.GET("/").WithQueryString("lang=" + langFirstPart).Expect().Status(httptest.StatusOK).
56-
Body().Equal(body)
56+
Body().IsEqual(body)
5757

5858
// test accept-language header prefix (i18n wrapper).
5959
e.GET("/"+lang).WithHeader("Accept-Language", lang).Expect().Status(httptest.StatusOK).
60-
Body().Equal(body)
60+
Body().IsEqual(body)
6161

6262
// test path prefix (i18n router wrapper).
6363
e.GET("/" + lang).Expect().Status(httptest.StatusOK).
64-
Body().Equal(body)
64+
Body().IsEqual(body)
6565

6666
// test path prefix with first part.
6767
e.GET("/" + langFirstPart).Expect().Status(httptest.StatusOK).
68-
Body().Equal(body)
68+
Body().IsEqual(body)
6969
}
7070

7171
e.GET("/other").WithQueryString("lang=el-GR").Expect().Status(httptest.StatusOK).
72-
Body().Equal(elgrMulti)
72+
Body().IsEqual(elgrMulti)
7373
e.GET("/other").WithQueryString("lang=en-US").Expect().Status(httptest.StatusOK).
74-
Body().Equal(enusMulti)
74+
Body().IsEqual(enusMulti)
7575

7676
// test path prefix (i18n router wrapper).
7777
e.GET("/el-gr/other").Expect().Status(httptest.StatusOK).
78-
Body().Equal(elgrMulti)
78+
Body().IsEqual(elgrMulti)
7979
e.GET("/en/other").Expect().Status(httptest.StatusOK).
80-
Body().Equal(enusMulti)
80+
Body().IsEqual(enusMulti)
8181

8282
e.GET("/el-GRtemplates").Expect().Status(httptest.StatusNotFound)
8383
e.GET("/el-templates").Expect().Status(httptest.StatusNotFound)
8484

8585
e.GET("/el/templates").Expect().Status(httptest.StatusOK).Body().Contains(elGR).Contains(zhCN)
8686

87-
e.GET("/not-matched").WithQuery("lang", "en-gb").Expect().Status(httptest.StatusOK).Body().Equal("user language input: en-gb: matched as: en-US: not found key: not_found_key: args: [some values 42]")
87+
e.GET("/not-matched").WithQuery("lang", "en-gb").Expect().Status(httptest.StatusOK).Body().IsEqual("user language input: en-gb: matched as: en-US: not found key: not_found_key: args: [some values 42]")
8888
}

_examples/i18n/template-embedded/main_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ func TestI18nLoaderFuncMap(t *testing.T) {
1111

1212
e := httptest.New(t, app)
1313
e.GET("/").Expect().Status(httptest.StatusOK).
14-
Body().Equal("Become a MEMBER")
14+
Body().IsEqual("Become a MEMBER")
1515
e.GET("/title").Expect().Status(httptest.StatusOK).
16-
Body().Equal("Account Connections")
16+
Body().IsEqual("Account Connections")
1717
e.GET("/").WithHeader("Accept-Language", "el").Expect().Status(httptest.StatusOK).
18-
Body().Equal("Γίνε ΜΈΛΟΣ")
18+
Body().IsEqual("Γίνε ΜΈΛΟΣ")
1919
e.GET("/title").WithHeader("Accept-Language", "el").Expect().Status(httptest.StatusOK).
20-
Body().Equal("Λογαριασμός Συνδέσεις")
20+
Body().IsEqual("Λογαριασμός Συνδέσεις")
2121
}

_examples/i18n/template/main_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ func TestI18nLoaderFuncMap(t *testing.T) {
1111

1212
e := httptest.New(t, app)
1313
e.GET("/").Expect().Status(httptest.StatusOK).
14-
Body().Equal("Become a MEMBER")
14+
Body().IsEqual("Become a MEMBER")
1515
e.GET("/title").Expect().Status(httptest.StatusOK).
16-
Body().Equal("Account Connections")
16+
Body().IsEqual("Account Connections")
1717
e.GET("/").WithHeader("Accept-Language", "el").Expect().Status(httptest.StatusOK).
18-
Body().Equal("Γίνε ΜΈΛΟΣ")
18+
Body().IsEqual("Γίνε ΜΈΛΟΣ")
1919
e.GET("/title").WithHeader("Accept-Language", "el").Expect().Status(httptest.StatusOK).
20-
Body().Equal("Λογαριασμός Συνδέσεις")
20+
Body().IsEqual("Λογαριασμός Συνδέσεις")
2121
}

_examples/logging/json-logger/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func TestJSONLogger(t *testing.T) {
3636
wg.Add(iters)
3737
for i := 0; i < iters; i++ {
3838
go func() {
39-
e.GET("/ping").Expect().Status(httptest.StatusOK).Body().Equal("pong")
39+
e.GET("/ping").Expect().Status(httptest.StatusOK).Body().IsEqual("pong")
4040
wg.Done()
4141
}()
4242
}

_examples/mvc/authenticated-controller/main_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ func TestMVCOverlapping(t *testing.T) {
1111

1212
e := httptest.New(t, app, httptest.URL("http://example.com"))
1313
// unauthenticated.
14-
e.GET("/user").Expect().Status(httptest.StatusOK).Body().Equal("custom action to redirect on authentication page")
14+
e.GET("/user").Expect().Status(httptest.StatusOK).Body().IsEqual("custom action to redirect on authentication page")
1515
// login.
1616
e.POST("/user/login").Expect().Status(httptest.StatusOK)
1717
// authenticated.
18-
e.GET("/user").Expect().Status(httptest.StatusOK).Body().Equal(`UserController.Get: The Authenticated type
18+
e.GET("/user").Expect().Status(httptest.StatusOK).Body().IsEqual(`UserController.Get: The Authenticated type
1919
can be used to secure a controller's method too.`)
2020
// logout.
2121
e.POST("/user/logout").Expect().Status(httptest.StatusOK)
2222
// unauthenticated.
23-
e.GET("/user").Expect().Status(httptest.StatusOK).Body().Equal("custom action to redirect on authentication page")
23+
e.GET("/user").Expect().Status(httptest.StatusOK).Body().IsEqual("custom action to redirect on authentication page")
2424
}

_examples/mvc/error-handler-http/main_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ func TestControllerHandleHTTPError(t *testing.T) {
1515
app := newApp()
1616

1717
e := httptest.New(t, app)
18-
e.GET("/").Expect().Status(httptest.StatusOK).Body().Equal(expectedIndex)
19-
e.GET("/a_notefound").Expect().Status(httptest.StatusNotFound).ContentType("text/html").Body().Equal(expectedNotFound)
18+
e.GET("/").Expect().Status(httptest.StatusOK).Body().IsEqual(expectedIndex)
19+
e.GET("/a_notefound").Expect().Status(httptest.StatusNotFound).ContentType("text/html").Body().IsEqual(expectedNotFound)
2020
}

_examples/mvc/grpc-compatible/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ func TestGRPCCompatible(t *testing.T) {
1212
e := httptest.New(t, app)
1313
e.POST("/helloworld.Greeter/SayHello").WithJSON(map[string]string{"name": "makis"}).Expect().
1414
Status(httptest.StatusOK).
15-
JSON().Equal(map[string]string{"message": "Hello makis"})
15+
JSON().IsEqual(map[string]string{"message": "Hello makis"})
1616
}

_examples/mvc/hello-world/main_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ func TestMVCHelloWorld(t *testing.T) {
1010
e := httptest.New(t, newApp())
1111

1212
e.GET("/").Expect().Status(httptest.StatusOK).
13-
ContentType("text/html", "utf-8").Body().Equal("<h1>Welcome</h1>")
13+
ContentType("text/html", "utf-8").Body().IsEqual("<h1>Welcome</h1>")
1414

1515
e.GET("/ping").Expect().Status(httptest.StatusOK).
16-
Body().Equal("pong")
16+
Body().IsEqual("pong")
1717

1818
e.GET("/hello").Expect().Status(httptest.StatusOK).
1919
JSON().Object().Value("message").Equal("Hello Iris!")
2020

2121
e.GET("/custom_path").Expect().Status(httptest.StatusOK).
22-
Body().Equal("hello from the custom handler without following the naming guide")
22+
Body().IsEqual("hello from the custom handler without following the naming guide")
2323
}

_examples/mvc/versioned-controller/main_test.go

+6-6
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ func TestVersionedController(t *testing.T) {
1313

1414
e := httptest.New(t, app)
1515
e.GET("/data").WithHeader(versioning.AcceptVersionHeaderKey, "1.0.0").Expect().
16-
Status(iris.StatusOK).Body().Equal("data (v1.x)")
16+
Status(iris.StatusOK).Body().IsEqual("data (v1.x)")
1717
e.GET("/data").WithHeader(versioning.AcceptVersionHeaderKey, "2.3.0").Expect().
18-
Status(iris.StatusOK).Body().Equal("data (v2.x)")
18+
Status(iris.StatusOK).Body().IsEqual("data (v2.x)")
1919
e.GET("/data").WithHeader(versioning.AcceptVersionHeaderKey, "3.1.0").Expect().
20-
Status(iris.StatusOK).Body().Equal("data (v3.x)")
20+
Status(iris.StatusOK).Body().IsEqual("data (v3.x)")
2121

2222
// Test invalid version or no version at all.
2323
e.GET("/data").WithHeader(versioning.AcceptVersionHeaderKey, "4.0.0").Expect().
24-
Status(iris.StatusOK).Body().Equal("data")
24+
Status(iris.StatusOK).Body().IsEqual("data")
2525
e.GET("/data").Expect().
26-
Status(iris.StatusOK).Body().Equal("data")
26+
Status(iris.StatusOK).Body().IsEqual("data")
2727

2828
// Test Deprecated (v1)
2929
ex := e.GET("/data").WithHeader(versioning.AcceptVersionHeaderKey, "1.0.0").Expect()
30-
ex.Status(iris.StatusOK).Body().Equal("data (v1.x)")
30+
ex.Status(iris.StatusOK).Body().IsEqual("data (v1.x)")
3131
ex.Header("X-API-Warn").Equal(opts.WarnMessage)
3232
expectedDateStr := opts.DeprecationDate.Format(app.ConfigurationReadOnly().GetTimeFormat())
3333
ex.Header("X-API-Deprecation-Date").Equal(expectedDateStr)

_examples/request-body/read-body/main_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,31 @@ func TestReadBodyAndNegotiate(t *testing.T) {
2020

2121
// Test send JSON and receive JSON.
2222
e.POST("/").WithJSON(expectedPayload).Expect().Status(httptest.StatusOK).
23-
JSON().Equal(expectedPayload)
23+
JSON().IsEqual(expectedPayload)
2424

2525
// Test send Form and receive XML.
2626
e.POST("/").WithForm(expectedPayload).
2727
WithHeader("Accept", "application/xml").
2828
Expect().Status(httptest.StatusOK).
29-
Body().Equal(expectedXMLPayload)
29+
Body().IsEqual(expectedXMLPayload)
3030

3131
// Test send URL Query and receive MessagePack.
3232
e.POST("/").WithQuery("message", expectedPayload.Message).
3333
WithHeader("Accept", "application/msgpack").
3434
Expect().Status(httptest.StatusOK).ContentType("application/msgpack").
35-
Body().Equal(expectedMsgPackPayload)
35+
Body().IsEqual(expectedMsgPackPayload)
3636

3737
// Test send MessagePack and receive MessagePack.
3838
e.POST("/").WithBytes([]byte(expectedMsgPackPayload)).
3939
WithHeader("Content-Type", "application/msgpack").
4040
WithHeader("Accept", "application/msgpack").
4141
Expect().Status(httptest.StatusOK).
42-
ContentType("application/msgpack").Body().Equal(expectedMsgPackPayload)
42+
ContentType("application/msgpack").Body().IsEqual(expectedMsgPackPayload)
4343

4444
// Test send YAML and receive YAML.
4545
e.POST("/").WithBytes([]byte(expectedYAMLPayload)).
4646
WithHeader("Content-Type", "application/x-yaml").
4747
WithHeader("Accept", "application/x-yaml").
4848
Expect().Status(httptest.StatusOK).
49-
ContentType("application/x-yaml").Body().Equal(expectedYAMLPayload)
49+
ContentType("application/x-yaml").Body().IsEqual(expectedYAMLPayload)
5050
}

_examples/request-body/read-custom-per-type/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ func TestReadCustomPerType(t *testing.T) {
1313
expectedResponse := `Received: main.config{Addr:"localhost:8080", ServerName:"Iris"}`
1414

1515
e.POST("/").WithText("addr: localhost:8080\nserverName: Iris").Expect().
16-
Status(httptest.StatusOK).Body().Equal(expectedResponse)
16+
Status(httptest.StatusOK).Body().IsEqual(expectedResponse)
1717
}

_examples/request-body/read-custom-via-unmarshaler/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ func TestReadCustomViaUnmarshaler(t *testing.T) {
1313
expectedResponse := `Received: main.config{Addr:"localhost:8080", ServerName:"Iris"}`
1414

1515
e.POST("/").WithText("addr: localhost:8080\nserverName: Iris").Expect().
16-
Status(httptest.StatusOK).Body().Equal(expectedResponse)
16+
Status(httptest.StatusOK).Body().IsEqual(expectedResponse)
1717
}

_examples/request-body/read-params/main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,5 @@ func TestReadParams(t *testing.T) {
1212
e := httptest.New(t, app)
1313

1414
expectedBody := `myParams: main.myParams{Name:"kataras", Age:27, Tail:[]string{"iris", "web", "framework"}}`
15-
e.GET("/kataras/27/iris/web/framework").Expect().Status(httptest.StatusOK).Body().Equal(expectedBody)
15+
e.GET("/kataras/27/iris/web/framework").Expect().Status(httptest.StatusOK).Body().IsEqual(expectedBody)
1616
}

0 commit comments

Comments
 (0)