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
Need better interactive test driver #5451
Comments
Can you signal the process rather than sending Ctrl-Z? |
@zanchey good suggestion, but I don't think so since that would require some form of backgrounding in order to get the fish instance to return In all cases, that was just an example of something I needed to do. There are cases where it's necessary to do other things, such as verify that stdin is correctly connected to the right job, etc. |
Okay, we have pexpect now which is nicer to work with than expect, because it's now python rather than tcl. I'm calling that good enough for now. |
Can we implement @mqudsi's tests above now? |
Something like sendline("cat | cat")
sendline("foo")
expect_str("foo")
sendline("set -l foo bar; echo $foo")
expect_str("set -l foo bar; echo $foo")
send("\x1A")
sendline("set -l foo bar; echo $foo")
expect_str("bar")
expect_prompt() should do? It seems to work in my tests - The fish script before the \x1A (ctrl-z) and comes back literally, and the script after is interpreted. |
Indeed, that looks great! |
I have a series of tests that I keep in my head and run manually when testing job control. I can't use the existing testing framework for these because it's incapable of interacting with child processes in any of the modes (C++, fish script, or expect).
As the simplest example, we need a scripted way to do this in an interactive fish session:
foo | less
Any suggestions on how this might be accomplished? The Tcl/expect scripts can't do the first bolded step, or at least, I can't figure out how to get them to do it. Input seems to always be directed either to the (local) console or to fish itself, but does not reach child procs.
The text was updated successfully, but these errors were encountered: