mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-15 23:22:53 +08:00
Add simple pexpect test for undo
This acts really strange, I haven't yet figured out why, but I guess it's a start.
This commit is contained in:
parent
4faebf74e6
commit
9f4255ed76
34
tests/pexpects/undo.py
Normal file
34
tests/pexpects/undo.py
Normal file
@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env python3
|
||||
from pexpect_helper import SpawnedProc
|
||||
|
||||
sp = SpawnedProc()
|
||||
send, sendline, sleep, expect_prompt, expect_re, expect_str = (
|
||||
sp.send,
|
||||
sp.sendline,
|
||||
sp.sleep,
|
||||
sp.expect_prompt,
|
||||
sp.expect_re,
|
||||
sp.expect_str,
|
||||
)
|
||||
expect_prompt()
|
||||
|
||||
sendline("bind Undo undo; bind Redo redo")
|
||||
expect_prompt()
|
||||
|
||||
send("echo word")
|
||||
expect_str("echo word")
|
||||
expect_str("echo word") # Not sure why we get this twice.
|
||||
|
||||
# FIXME why does this only undo one character? It undoes the entire word when run interactively.
|
||||
send("Undo")
|
||||
expect_str("echo wor")
|
||||
|
||||
send("Undo")
|
||||
expect_str("echo ")
|
||||
|
||||
send("Redo")
|
||||
expect_str("echo wor")
|
||||
|
||||
# FIXME see above.
|
||||
send("Redo")
|
||||
expect_str("echo word")
|
Loading…
x
Reference in New Issue
Block a user