gavv/httpexpect

Improve bodyWrapper Rewind test

gavv opened this issue · 3 comments

gavv commented

bodyWrapper is an internal struct that wraps HTTP response body and allows to read it multiple times using Rewind and GetBody methods. See comments for details.

Currently TestBodyWrapper_Rewind has two subtests:

  • "readall - close - rewind - readall"
  • "rewind - readall - close - rewind - readall"

Subtest name describes the order of performed operations.

It would be nice to cover a few more combinations of operations:

  • "readall - rewind - readall" (no close before rewind)
  • "close - rewind - readall" (no readall before rewind)
  • "rewind - readall - rewind - readall" (no close after rewind)
  • "rewind - close - rewind - readall" (no readall after rewind)
  • "loop" ("readall - close - rewind" repeated a few times)

hi @gavv i'd like to work on this

gavv commented

@AnandaIlyasa Welcome, thanks!

gavv commented

Merged via 8d90e3b, thanks!