samisagit / natskell

A NATS client library written in Haskell
MIT License
7 stars 0 forks source link

Programmatically build test cases and assertions #34

Closed samisagit closed 1 year ago

samisagit commented 2 years ago

Range over options for each component part of each protocol message to generate cases and assertions. Similar to how the CONNECT transformer tests work.

samisagit commented 2 years ago

Blocked by #43

samisagit commented 2 years ago

We might be able to use the fuzz tests arbitrary generators, given a finite list of real world example inputs to simplify this.

samisagit commented 2 years ago

Went with the path of least resistance, for loops over arrays of field values. It works for now.

samisagit commented 2 years ago

To note these generated cases should not replace explicit cases. We have very few explicit test cases against the library at present. Particularly because we won't be including the generated cases on a typical test run.

samisagit commented 2 years ago

Went with the path of least resistance, for loops over arrays of field values. It works for now.

Found a way better way of doing this using applicative form. Much easier to read and write.

samisagit commented 2 years ago

To note these generated cases should not replace explicit cases. We have very few explicit test cases against the library at present. Particularly because we won't be including the generated cases on a typical test run.

Further to this generated tests are only for the parsers (for the time being) so we need a decent amount of explicit tests in other areas.