mirror of
https://github.com/kataras/iris.git
synced 2025-12-20 03:17:04 +00:00
minor, see prev commit
This commit is contained in:
@@ -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.ResponseWriter](https://golang.org/pkg/net/http/#ResponseWriter) | `ctx.ResponseWriter()` |
|
||||||
| [http.Header](https://golang.org/pkg/net/http/#Header) | `ctx.Request().Header` |
|
| [http.Header](https://golang.org/pkg/net/http/#Header) | `ctx.Request().Header` |
|
||||||
| [time.Time](https://golang.org/pkg/time/#Time) | `time.Now()` |
|
| [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())` |
|
| [net.IP](https://golang.org/pkg/net/#IP) | `net.ParseIP(ctx.RemoteAddr())` |
|
||||||
| `string`, | |
|
| `string`, | |
|
||||||
| `int, int8, int16, int32, int64`, | |
|
| `int, int8, int16, int32, int64`, | |
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import (
|
|||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
"github.com/kataras/golog"
|
||||||
"github.com/kataras/iris/v12/context"
|
"github.com/kataras/iris/v12/context"
|
||||||
"github.com/kataras/iris/v12/sessions"
|
"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.
|
// test std context, session, time, request, response writer and headers bindings.
|
||||||
{ // 12
|
{ // 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"}
|
return testResponse{"builtin deps"}
|
||||||
},
|
},
|
||||||
Expected: []*binding{
|
Expected: []*binding{
|
||||||
@@ -199,11 +200,11 @@ func TestGetBindingsForFunc(t *testing.T) {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
Dependency: NewDependency(BuiltinDependencies[3]),
|
Dependency: NewDependency(BuiltinDependencies[3]),
|
||||||
Input: &Input{Index: 2, Type: timeTyp},
|
Input: &Input{Index: 2, Type: BuiltinDependencies[3].DestType},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Dependency: NewDependency(BuiltinDependencies[4]),
|
Dependency: NewDependency(BuiltinDependencies[4]),
|
||||||
Input: &Input{Index: 3, Type: BuiltinDependencies[4].DestType},
|
Input: &Input{Index: 3, Type: timeTyp},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Dependency: NewDependency(BuiltinDependencies[5]),
|
Dependency: NewDependency(BuiltinDependencies[5]),
|
||||||
@@ -213,6 +214,10 @@ func TestGetBindingsForFunc(t *testing.T) {
|
|||||||
Dependency: NewDependency(BuiltinDependencies[6]),
|
Dependency: NewDependency(BuiltinDependencies[6]),
|
||||||
Input: &Input{Index: 5, Type: BuiltinDependencies[6].DestType},
|
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
|
// test explicitly of http.Header and its underline type map[string][]string which
|
||||||
@@ -225,8 +230,8 @@ func TestGetBindingsForFunc(t *testing.T) {
|
|||||||
},
|
},
|
||||||
Expected: []*binding{
|
Expected: []*binding{
|
||||||
{
|
{
|
||||||
Dependency: NewDependency(BuiltinDependencies[6]),
|
Dependency: NewDependency(BuiltinDependencies[7]),
|
||||||
Input: &Input{Index: 0, Type: BuiltinDependencies[6].DestType},
|
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.
|
Expected: []*binding{ // only http.Header should be binded, we don't have map[string][]string registered.
|
||||||
{
|
{
|
||||||
Dependency: NewDependency(BuiltinDependencies[6]),
|
Dependency: NewDependency(BuiltinDependencies[7]),
|
||||||
Input: &Input{Index: 0, Type: BuiltinDependencies[6].DestType},
|
Input: &Input{Index: 0, Type: BuiltinDependencies[7].DestType},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
Dependency: deps[len(deps)-1],
|
Dependency: deps[len(deps)-1],
|
||||||
|
|||||||
Reference in New Issue
Block a user