summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2021-07-22 14:26:13 +0300
committerValery Piashchynski <[email protected]>2021-07-22 14:26:13 +0300
commitfedf012e632a31d2d0837c22832c7683547ad379 (patch)
treebcb5634dfacccc6d34e49aa7337ac8d1f18b693c /tests
parent609e61426b137834ac589c88f1124574f939fa67 (diff)
BC for the Pool, worker interfaces, pass/return payload by pointer
Signed-off-by: Valery Piashchynski <[email protected]>
Diffstat (limited to 'tests')
-rw-r--r--tests/plugins/http/response_test.go14
-rw-r--r--tests/plugins/server/plugin_pipes.go2
-rw-r--r--tests/plugins/server/plugin_sockets.go2
-rw-r--r--tests/plugins/server/plugin_tcp.go2
-rw-r--r--tests/plugins/service/placeholder.go1
5 files changed, 10 insertions, 11 deletions
diff --git a/tests/plugins/http/response_test.go b/tests/plugins/http/response_test.go
index 276c22ef..f754429d 100644
--- a/tests/plugins/http/response_test.go
+++ b/tests/plugins/http/response_test.go
@@ -45,13 +45,13 @@ func (tw *testWriter) Push(target string, opts *http.PushOptions) error {
}
func TestNewResponse_Error(t *testing.T) {
- r, err := handler.NewResponse(payload.Payload{Context: []byte(`invalid payload`)})
+ r, err := handler.NewResponse(&payload.Payload{Context: []byte(`invalid payload`)})
assert.Error(t, err)
assert.Nil(t, r)
}
func TestNewResponse_Write(t *testing.T) {
- r, err := handler.NewResponse(payload.Payload{
+ r, err := handler.NewResponse(&payload.Payload{
Context: []byte(`{"headers":{"key":["value"]},"status": 301}`),
Body: []byte(`sample body`),
})
@@ -68,7 +68,7 @@ func TestNewResponse_Write(t *testing.T) {
}
func TestNewResponse_Stream(t *testing.T) {
- r, err := handler.NewResponse(payload.Payload{
+ r, err := handler.NewResponse(&payload.Payload{
Context: []byte(`{"headers":{"key":["value"]},"status": 301}`),
})
@@ -93,7 +93,7 @@ func TestNewResponse_Stream(t *testing.T) {
}
func TestNewResponse_StreamError(t *testing.T) {
- r, err := handler.NewResponse(payload.Payload{
+ r, err := handler.NewResponse(&payload.Payload{
Context: []byte(`{"headers":{"key":["value"]},"status": 301}`),
})
@@ -114,7 +114,7 @@ func TestNewResponse_StreamError(t *testing.T) {
}
func TestWrite_HandlesPush(t *testing.T) {
- r, err := handler.NewResponse(payload.Payload{
+ r, err := handler.NewResponse(&payload.Payload{
Context: []byte(`{"headers":{"Http2-Push":["/test.js"],"content-type":["text/html"]},"status": 200}`),
})
@@ -129,7 +129,7 @@ func TestWrite_HandlesPush(t *testing.T) {
}
func TestWrite_HandlesTrailers(t *testing.T) {
- r, err := handler.NewResponse(payload.Payload{
+ r, err := handler.NewResponse(&payload.Payload{
Context: []byte(`{"headers":{"Trailer":["foo, bar", "baz"],"foo":["test"],"bar":["demo"]},"status": 200}`),
})
@@ -148,7 +148,7 @@ func TestWrite_HandlesTrailers(t *testing.T) {
}
func TestWrite_HandlesHandlesWhitespacesInTrailer(t *testing.T) {
- r, err := handler.NewResponse(payload.Payload{
+ r, err := handler.NewResponse(&payload.Payload{
Context: []byte(
`{"headers":{"Trailer":["foo\t,bar , baz"],"foo":["a"],"bar":["b"],"baz":["c"]},"status": 200}`),
})
diff --git a/tests/plugins/server/plugin_pipes.go b/tests/plugins/server/plugin_pipes.go
index e813e456..d136da1e 100644
--- a/tests/plugins/server/plugin_pipes.go
+++ b/tests/plugins/server/plugin_pipes.go
@@ -45,7 +45,7 @@ func (f *Foo) Serve() chan error {
const op = errors.Op("serve")
// test payload for echo
- r := payload.Payload{
+ r := &payload.Payload{
Context: nil,
Body: []byte(Response),
}
diff --git a/tests/plugins/server/plugin_sockets.go b/tests/plugins/server/plugin_sockets.go
index 0b2857e3..143a604c 100644
--- a/tests/plugins/server/plugin_sockets.go
+++ b/tests/plugins/server/plugin_sockets.go
@@ -30,7 +30,7 @@ func (f *Foo2) Serve() chan error {
conf := &server.Config{}
// test payload for echo
- r := payload.Payload{
+ r := &payload.Payload{
Context: nil,
Body: []byte(Response),
}
diff --git a/tests/plugins/server/plugin_tcp.go b/tests/plugins/server/plugin_tcp.go
index ef4cea39..57a2e6ea 100644
--- a/tests/plugins/server/plugin_tcp.go
+++ b/tests/plugins/server/plugin_tcp.go
@@ -30,7 +30,7 @@ func (f *Foo3) Serve() chan error {
conf := &server.Config{}
// test payload for echo
- r := payload.Payload{
+ r := &payload.Payload{
Context: nil,
Body: []byte(Response),
}
diff --git a/tests/plugins/service/placeholder.go b/tests/plugins/service/placeholder.go
deleted file mode 100644
index 6d43c336..00000000
--- a/tests/plugins/service/placeholder.go
+++ /dev/null
@@ -1 +0,0 @@
-package service