-
Notifications
You must be signed in to change notification settings - Fork 622
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add history-/history-cases-test, using readline
- Loading branch information
1 parent
8a1a2c6
commit f8d83c7
Showing
2 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
#!/bin/sh | ||
|
||
. libtest.sh | ||
. libgit.sh | ||
|
||
export LINES=3 | ||
export COLUMNS=80 | ||
|
||
test_require readline | ||
|
||
in_work_dir create_repo_from_tgz "$base_dir/files/scala-js-benchmarks.tgz" | ||
|
||
test_case one \ | ||
--before='rm -f -- "$HOME/.tig_history"' \ | ||
--tigrc='set history-size = 10' \ | ||
--keystrokes=':echo keys_one\r:quit\r' \ | ||
--assert-equals=".tig_history"='echo keys_one | ||
quit | ||
' \ | ||
<<EOF | ||
2014-03-01 17:26 Jonas Fonseca o [master] WIP: Upgrade to 0.4-SNAPSHOT and | ||
[main] ee912870202200a0b9cf4fd86ba57243212d341e - commit 1 of 48 2% | ||
EOF | ||
|
||
test_case two \ | ||
--before='rm -f -- "$HOME/.tig_history"' \ | ||
--tigrc='set history-size = 10' \ | ||
--keystrokes=':echo keys_two\r:quit\r' \ | ||
--assert-equals=".tig_history"="echo first_line | ||
echo second_line | ||
save-display $HOME/two.screen | ||
echo keys_two | ||
quit | ||
" \ | ||
--script=':echo first_line | ||
:echo second_line' \ | ||
<<EOF | ||
2014-03-01 17:26 Jonas Fonseca o [master] WIP: Upgrade to 0.4-SNAPSHOT and | ||
[main] ee912870202200a0b9cf4fd86ba57243212d341e - commit 1 of 48 2% | ||
EOF | ||
|
||
test_case three \ | ||
--before='rm -f -- "$HOME/.tig_history"' \ | ||
--tigrc='set history-size = 10' \ | ||
--assert-equals=".tig_history"="echo first_line | ||
echo second_line | ||
save-display $HOME/three.screen | ||
quit | ||
" \ | ||
--script=':echo first_line | ||
:echo second_line' <<EOF | ||
2014-03-01 17:26 Jonas Fonseca o [master] WIP: Upgrade to 0.4-SNAPSHOT and | ||
[main] ee912870202200a0b9cf4fd86ba57243212d341e - commit 1 of 48 2% | ||
EOF | ||
|
||
test_case four \ | ||
--before='rm -f -- "$HOME/.tig_history"' \ | ||
--tigrc='set history-size = 10' \ | ||
--keystrokes=':echo keys_four\r:quit\r' \ | ||
--assert-equals=".tig_history"='echo keys_four | ||
quit | ||
' \ | ||
<<EOF | ||
2014-03-01 17:26 Jonas Fonseca o [master] WIP: Upgrade to 0.4-SNAPSHOT and | ||
[main] ee912870202200a0b9cf4fd86ba57243212d341e - commit 1 of 48 2% | ||
EOF | ||
|
||
run_test_cases |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/sh | ||
|
||
. libtest.sh | ||
. libgit.sh | ||
|
||
export LINES=3 | ||
export COLUMNS=80 | ||
|
||
test_require readline | ||
|
||
in_work_dir create_repo_from_tgz "$base_dir/files/scala-js-benchmarks.tgz" | ||
|
||
tigrc <<EOF | ||
set history-size = 3 | ||
EOF | ||
|
||
keystrokes ':none' | ||
keystrokes -append -keysym 'Enter' | ||
keystrokes -append ':quit' | ||
keystrokes -append -keysym 'Enter' | ||
|
||
test_tig | ||
|
||
assert_equals stderr <<EOF | ||
EOF | ||
|
||
assert_equals "$HOME/.tig_history" <<EOF | ||
none | ||
quit | ||
EOF |