Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support pexpect like instructions for stdin/stdout #102

Open
dnaka91 opened this issue Jun 10, 2022 · 1 comment
Open

Support pexpect like instructions for stdin/stdout #102

dnaka91 opened this issue Jun 10, 2022 · 1 comment
Labels
enhancement Improve the expected

Comments

@dnaka91
Copy link

dnaka91 commented Jun 10, 2022

Split off from #101 and would likely need it to be implemented first, to be of real use.

It would be really cool, to have some custom format for the stdin/stdout content, that allows for similar patterns as in pecpect (or rather the rexpect/expectrl crates). This would allow to easily test interactive programs.

What quickly comes to mind would be something like:

> What is your name?
< Bob
> Alive? [Yn]
< y
...

Where > defines some stdout from the program that is checked against, as either plain text or maybe regex.
And < would describe the input to be passed to the program if the previous check succeeded. Maybe would need some nice helpers to send arrow up/down, return and other special keys and control sequences.

@epage epage added the enhancement Improve the expected label Jun 10, 2022
@epage
Copy link
Contributor

epage commented Jun 10, 2022

Links to somewhat related crates

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improve the expected
Projects
None yet
Development

No branches or pull requests

2 participants