[testing] best practices for the test (client-server)

69 views
Skip to first unread message

sumith s

unread,
Aug 7, 2023, 8:27:53 AM8/7/23
to golang-nuts
Hi,

Anyone have suggestion for writing test  cases (best practices ) for client server communication.

Eli Lindsey

unread,
Aug 7, 2023, 3:17:29 PM8/7/23
to sumith s, golang-nuts
net/http/httptest is a great package, either to use if your server is http-based or to emulate if you’re testing other protocols. I’ve also found io.Pipe to frequently be useful for this kind of testing.

I’d recommend reading through how net/http and x/net/http2 structures their tests.

-eli

On Aug 7, 2023, at 8:27 AM, sumith s <sumith...@gmail.com> wrote:

Hi,

Anyone have suggestion for writing test  cases (best practices ) for client server communication.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/3fcc47e1-9610-4fa9-b2a8-bf7a408f546dn%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages