The testing setup is a bit verbose and requires a lot of copy-pasting. Also, I am somewhat worried about tests overlapping since in some of the cases there are multiple tests which overlap and run on the same 'testing instance'.
I guess it would be nice to have a convenient 'meta-command' which executes a list of arguments, with expected success / failure and with associated stdout / stderr assertions, and handles the TestState::init and TestState::close boilerplate automatically. Also we should import predicate::str::contains..
I guess internally there could be a TestCommand struct which contains the arguments, whether it should succeed or fail, and then possibly some predicates to execute on stdout or stderr. The annoyance is that we cannot store predicates internally inside such a struct since predicates all have different types / signatures, so perhaps correct way to do this would be to have a macro.
The testing setup is a bit verbose and requires a lot of copy-pasting. Also, I am somewhat worried about tests overlapping since in some of the cases there are multiple tests which overlap and run on the same 'testing instance'.
I guess it would be nice to have a convenient 'meta-command' which executes a list of arguments, with expected success / failure and with associated stdout / stderr assertions, and handles the
TestState::init
andTestState::close
boilerplate automatically. Also we should importpredicate::str::contains
..I guess internally there could be a
TestCommand
struct which contains the arguments, whether it should succeed or fail, and then possibly some predicates to execute on stdout or stderr. The annoyance is that we cannot store predicates internally inside such a struct since predicates all have different types / signatures, so perhaps correct way to do this would be to have a macro.