Open godzie44 opened 1 year ago
rustyline
doesn't behave correctly with expect
/ pexpect
.So maybe we should introduce a feature X (for testing) that deactivates input buffering ? And maybe when this feature X is activated, external_printer are disabled ? (I am not sure that we can actually activate a feature only for testing)
Yep i think better if feature for testing will be on rustyline
side.
But there is still a problem, that output observable by user and output observable by integration tests may be different.
I'm using rustyline and python pexpect for integration testing. This worked fine, until i'm try to use an external_printer. With external_printer pextect.send do nothing.
Steps to reproduce
This can be reproduced on
external_print
example:and so on, expected output "Line: 123" never reads.
Workaround
In my app i use cfg conditional checks for determine test environment or not, then in test env i replace
external_printer.print
toprintln!
, but would be nice to have a better workaround...