pires / go-proxyproto

A Go library implementation of the PROXY protocol, versions 1 and 2.
Apache License 2.0
478 stars 107 forks source link

Revisit tests to reduce duplicated code #72

Open pires opened 3 years ago

pires commented 3 years ago

For instance, in protocol_test.go, there are many repetitions of code that binds to a socket (listen), accepts connections, writes and reads data from each connection. I think these can be condensed to a low single digit number of parameterized functions that are then called in the tests.