From 676048666cab7bd4404aafef77d8f59badd93833 Mon Sep 17 00:00:00 2001 From: "Gerasimos (Makis) Maropoulos" Date: Sat, 1 Aug 2020 05:11:08 +0300 Subject: [PATCH] minor, see prev commit --- HISTORY.md | 2 +- hero/binding_test.go | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/HISTORY.md b/HISTORY.md index 1ffbae49..523ce10a 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -153,7 +153,7 @@ Prior to this version the `iris.Context` was the only one dependency that has be | [http.ResponseWriter](https://golang.org/pkg/net/http/#ResponseWriter) | `ctx.ResponseWriter()` | | [http.Header](https://golang.org/pkg/net/http/#Header) | `ctx.Request().Header` | | [time.Time](https://golang.org/pkg/time/#Time) | `time.Now()` | -| [golog.Logger](https://pkg.go.dev/github.com/kataras/golog) | Iris Logger | +| [*golog.Logger](https://pkg.go.dev/github.com/kataras/golog) | Iris Logger | | [net.IP](https://golang.org/pkg/net/#IP) | `net.ParseIP(ctx.RemoteAddr())` | | `string`, | | | `int, int8, int16, int32, int64`, | | diff --git a/hero/binding_test.go b/hero/binding_test.go index b9ef8449..40d05c52 100644 --- a/hero/binding_test.go +++ b/hero/binding_test.go @@ -8,6 +8,7 @@ import ( "testing" "time" + "github.com/kataras/golog" "github.com/kataras/iris/v12/context" "github.com/kataras/iris/v12/sessions" ) @@ -185,7 +186,7 @@ func TestGetBindingsForFunc(t *testing.T) { }, // test std context, session, time, request, response writer and headers bindings. { // 12 - Func: func(stdContext.Context, *sessions.Session, time.Time, *http.Request, http.ResponseWriter, http.Header) testResponse { + Func: func(stdContext.Context, *sessions.Session, *golog.Logger, time.Time, *http.Request, http.ResponseWriter, http.Header) testResponse { return testResponse{"builtin deps"} }, Expected: []*binding{ @@ -199,11 +200,11 @@ func TestGetBindingsForFunc(t *testing.T) { }, { Dependency: NewDependency(BuiltinDependencies[3]), - Input: &Input{Index: 2, Type: timeTyp}, + Input: &Input{Index: 2, Type: BuiltinDependencies[3].DestType}, }, { Dependency: NewDependency(BuiltinDependencies[4]), - Input: &Input{Index: 3, Type: BuiltinDependencies[4].DestType}, + Input: &Input{Index: 3, Type: timeTyp}, }, { Dependency: NewDependency(BuiltinDependencies[5]), @@ -213,6 +214,10 @@ func TestGetBindingsForFunc(t *testing.T) { Dependency: NewDependency(BuiltinDependencies[6]), Input: &Input{Index: 5, Type: BuiltinDependencies[6].DestType}, }, + { + Dependency: NewDependency(BuiltinDependencies[7]), + Input: &Input{Index: 6, Type: BuiltinDependencies[7].DestType}, + }, }, }, // test explicitly of http.Header and its underline type map[string][]string which @@ -225,8 +230,8 @@ func TestGetBindingsForFunc(t *testing.T) { }, Expected: []*binding{ { - Dependency: NewDependency(BuiltinDependencies[6]), - Input: &Input{Index: 0, Type: BuiltinDependencies[6].DestType}, + Dependency: NewDependency(BuiltinDependencies[7]), + Input: &Input{Index: 0, Type: BuiltinDependencies[7].DestType}, }, }, }, @@ -247,8 +252,8 @@ func TestGetBindingsForFunc(t *testing.T) { }, Expected: []*binding{ // only http.Header should be binded, we don't have map[string][]string registered. { - Dependency: NewDependency(BuiltinDependencies[6]), - Input: &Input{Index: 0, Type: BuiltinDependencies[6].DestType}, + Dependency: NewDependency(BuiltinDependencies[7]), + Input: &Input{Index: 0, Type: BuiltinDependencies[7].DestType}, }, { Dependency: deps[len(deps)-1],