Skip to content

Commit

Permalink
Review comments - add test for panic
Browse files Browse the repository at this point in the history
  • Loading branch information
witriew committed Aug 30, 2021
1 parent 515534d commit 274184e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions encoding/thrift/outbound_nowire_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"go.uber.org/thriftrw/protocol"
tbinary "go.uber.org/thriftrw/protocol/binary"
"go.uber.org/thriftrw/protocol/stream"
"go.uber.org/thriftrw/thrifttest"
"go.uber.org/thriftrw/thrifttest/streamtest"
"go.uber.org/thriftrw/wire"
"go.uber.org/yarpc/api/transport"
Expand Down Expand Up @@ -319,6 +320,17 @@ func TestNoWireClientOneway(t *testing.T) {
}
}

func TestNoNewWireBadProtocolConfig(t *testing.T) {
mockCtrl := gomock.NewController(t)
defer mockCtrl.Finish()

proto := thrifttest.NewMockProtocol(mockCtrl)
assert.Panics(t,
func() {
NewNoWire(Config{}, Protocol(proto))
})
}

// encodeThriftString prefixes the passed in string with an int32 that contains
// the length of the string, compliant to the Thrift protocol.
func encodeThriftString(t *testing.T, s string) string {
Expand Down

0 comments on commit 274184e

Please sign in to comment.