This crate allows you to easily use technique called print testing
(further just PT). Rather then explicitly asserting with hardcoded values PT allows for more declarative testing. Each test is passed a buffer (&mut String
) to whitch it should output deperministic sequence of characters that represent some code outcome. When you add a new test, it will initialy always panic until you accept it as valid. After accepting, each subsequent test just checks if output of each test changed. If somting changes, test fails and you eill be presented with a git like diff of what changed. The fact that outpuch changed acn be interpreted in many ways, either its intentional in which case joy just accept changes or test actually broke and you proceed with usual steps when test breaks.
To pass arguments to the print tests, you unfortunately need to set environment variables. Here are the possible oprions with coresponding default values:
```bash
::
is replaced with -
, this alsoPRINTTESTCACHE_DIR=print-test-cache
PRINTTESTWRITE_CHANGES=false ```