Skip to contents

s7contract makes behavioral protocols explicit and testable around ordinary S7 dispatch:

Details

  • Go-like structural interfaces defined by required generics.

  • Rust-like explicit traits with default methods and associated metadata.

  • Optional argument and return specifications checked at the point of use.

  • Property-based laws with integrated shrinking and tinytest expectations.

implements() checks method availability and has_trait() checks declared implementation. check_law() tests behavior over generated cases. Protocol authors can reuse laws across implementations by writing functions that construct lists of laws; see vignette("protocol-laws"). new_state_law() tests sequences of commands against a reference model with fresh fixtures.

Author

Maintainer: Sounkou Mahamane Toure sounkoutoure@gmail.com