Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add robust tests cases for middleware.NewWrapResponseWriter() #835

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

VojtechVitek
Copy link
Contributor

Ref. #793 bug at #793 (review)

Comment on lines +41 to +65
{protoMajor: 1, w: none{}},
{protoMajor: 1, w: flusher{}, fl: true},
{protoMajor: 1, w: hijacker{}, hj: true},
{protoMajor: 1, w: readerFrom{}, rf: true},
{protoMajor: 1, w: flusherHijacker{}, fl: true, hj: true},
{protoMajor: 1, w: flusherReaderFrom{}, fl: true, rf: true},
{protoMajor: 1, w: hijackerReaderFrom{}, hj: true, rf: true},
{protoMajor: 1, w: flusherHijackerReaderFrom{}, fl: true, hj: true, rf: true},

{protoMajor: 2, w: none{}},
{protoMajor: 2, w: flusher{}, fl: true},
{protoMajor: 2, w: hijacker{}, hj: true},
{protoMajor: 2, w: readerFrom{}, rf: true},
{protoMajor: 2, w: pusher{}, ps: true},
{protoMajor: 2, w: flusherPusher{}, fl: true, ps: true},
{protoMajor: 2, w: readerFromPusher{}, rf: true, ps: true},
{protoMajor: 2, w: hijackerPusher{}, hj: true, ps: true},
{protoMajor: 2, w: flusherHijacker{}, fl: true, hj: true},
{protoMajor: 2, w: flusherReaderFrom{}, fl: true, rf: true},
{protoMajor: 2, w: hijackerReaderFrom{}, hj: true, rf: true},
{protoMajor: 2, w: flusherHijackerReaderFrom{}, fl: true, hj: true, rf: true},
{protoMajor: 2, w: flusherHijackerPusher{}, fl: true, hj: true, ps: true},
{protoMajor: 2, w: flusherReaderFromPusher{}, fl: true, rf: true, ps: true},
{protoMajor: 2, w: hijackerReaderFromPusher{}, hj: true, rf: true, ps: true},
{protoMajor: 2, w: flusherHijackerReaderFromPusher{}, fl: true, hj: true, rf: true, ps: true},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

=== RUN   TestWrapResponseWriter
    wrap_writer_test.go:110: *middleware.basicWriter(middleware.readerFrom).(io.ReaderFrom) is false
    wrap_writer_test.go:110: *middleware.flushWriter(middleware.flusherReaderFrom).(io.ReaderFrom) is false
    wrap_writer_test.go:110: *middleware.hijackWriter(middleware.hijackerReaderFrom).(io.ReaderFrom) is false
    wrap_writer_test.go:105: *middleware.basicWriter(middleware.hijacker).(http.Hijacker) is false
    wrap_writer_test.go:110: *middleware.basicWriter(middleware.readerFrom).(io.ReaderFrom) is false
    wrap_writer_test.go:115: *middleware.basicWriter(middleware.pusher).(http.Pusher) is false
    wrap_writer_test.go:110: *middleware.basicWriter(middleware.readerFromPusher).(io.ReaderFrom) is false
    wrap_writer_test.go:115: *middleware.basicWriter(middleware.readerFromPusher).(http.Pusher) is false
    wrap_writer_test.go:105: *middleware.basicWriter(middleware.hijackerPusher).(http.Hijacker) is false
    wrap_writer_test.go:115: *middleware.basicWriter(middleware.hijackerPusher).(http.Pusher) is false
    wrap_writer_test.go:105: *middleware.flushWriter(middleware.flusherHijacker).(http.Hijacker) is false
    wrap_writer_test.go:110: *middleware.flushWriter(middleware.flusherReaderFrom).(io.ReaderFrom) is false
    wrap_writer_test.go:105: *middleware.basicWriter(middleware.hijackerReaderFrom).(http.Hijacker) is false
    wrap_writer_test.go:110: *middleware.basicWriter(middleware.hijackerReaderFrom).(io.ReaderFrom) is false
    wrap_writer_test.go:105: *middleware.flushWriter(middleware.flusherHijackerReaderFrom).(http.Hijacker) is false
    wrap_writer_test.go:110: *middleware.flushWriter(middleware.flusherHijackerReaderFrom).(io.ReaderFrom) is false
    wrap_writer_test.go:105: *middleware.http2FancyWriter(middleware.flusherHijackerPusher).(http.Hijacker) is false
    wrap_writer_test.go:110: *middleware.http2FancyWriter(middleware.flusherReaderFromPusher).(io.ReaderFrom) is false
    wrap_writer_test.go:105: *middleware.basicWriter(middleware.hijackerReaderFromPusher).(http.Hijacker) is false
    wrap_writer_test.go:110: *middleware.basicWriter(middleware.hijackerReaderFromPusher).(io.ReaderFrom) is false
    wrap_writer_test.go:115: *middleware.basicWriter(middleware.hijackerReaderFromPusher).(http.Pusher) is false
    wrap_writer_test.go:105: *middleware.http2FancyWriter(middleware.flusherHijackerReaderFromPusher).(http.Hijacker) is false
    wrap_writer_test.go:110: *middleware.http2FancyWriter(middleware.flusherHijackerReaderFromPusher).(io.ReaderFrom) is false
    wrap_writer_test.go:121: 73/96 test cases passed

We currently don't handle couple of combinations.. Do we care to fix them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant