Skip to content

Commit 1d3a245

Browse files
committed
add script-test, using non-readline keystrokes
simulated keys can work around the inability of scripts to run other scripts
1 parent 6880ba2 commit 1d3a245

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

test/tigrc/script-test

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/sh
2+
3+
. libtest.sh
4+
. libgit.sh
5+
6+
LINES=12
7+
COLUMNS=200
8+
9+
in_work_dir create_repo_from_tgz "$base_dir/files/scala-js-benchmarks.tgz"
10+
11+
export TIGRC_SYSTEM=does-not-exist
12+
13+
file "$HOME/.tigrc.bind.q.for.help.screen" <<EOF
14+
:bind generic q quit
15+
:view-help
16+
:save-display $HOME/help.screen
17+
EOF
18+
19+
tigrc <<EOF
20+
bind generic : prompt # Must have prompt mapping to execute script
21+
bind generic S :script $HOME/.tigrc.bind.q.for.help.screen
22+
EOF
23+
24+
keystrokes 'Sq'
25+
26+
test_tig
27+
28+
assert_equals stderr <<EOF
29+
EOF
30+
31+
assert_equals "$HOME/help.screen" <<EOF
32+
Quick reference for tig keybindings:
33+
34+
[-] generic bindings
35+
View manipulation
36+
q quit Close all views and quit
37+
Misc
38+
: prompt Open the prompt
39+
Internal commands:
40+
S :script $HOME/.tigrc.bind.q.for.help.screen
41+
42+
[help] - line 1 of 9 100%
43+
EOF

0 commit comments

Comments
 (0)