mirror of
https://github.com/tmux-plugins/tpm.git
synced 2025-09-14 00:46:56 +00:00
Refactor test 'expect' scripts
Make test 'expect' scripts simpler and ensure expectations are properly asserted. Closes #46
This commit is contained in:
@ -15,40 +15,36 @@ send "I"
|
||||
# cloning might take a while
|
||||
set timeout 15
|
||||
|
||||
expect_after {
|
||||
timeout { exit 1 }
|
||||
}
|
||||
|
||||
expect {
|
||||
"Installing \"tmux-example-plugin\"" {
|
||||
"Installing \"tmux-example-plugin\""
|
||||
}
|
||||
|
||||
expect {
|
||||
"\"tmux-example-plugin\" download success" {
|
||||
expect {
|
||||
"\"tmux-example-plugin\" download success"
|
||||
}
|
||||
|
||||
expect { "Done, press ENTER to continue" {
|
||||
send "
|
||||
"
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
timeout {
|
||||
puts "Plugin installation timeout (1)";
|
||||
expect {
|
||||
"Done, press ENTER to continue" {
|
||||
send "
|
||||
"
|
||||
}
|
||||
}
|
||||
|
||||
sleep 1
|
||||
# this is tmux prefix + I
|
||||
send "I"
|
||||
|
||||
expect {
|
||||
expect {
|
||||
"Already installed \"tmux-example-plugin\""
|
||||
}
|
||||
|
||||
expect { "Done, press ENTER to continue" { exit 0 } }
|
||||
|
||||
}
|
||||
|
||||
timeout {
|
||||
puts "Plugin installation timeout (2)";
|
||||
|
||||
expect {
|
||||
"Done, press ENTER to continue" {
|
||||
exit 0
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user