Skip to content

Commit 2f35bf6

Browse files
committed
Update tests
1. help/default-test The action name field is wider causing re-alignment of help text. 2. tigrc/parse-test Comment for a key binding is now exposed as help text. 3. help/user-command-comment-test Add a new test for defining user comments for user commands.
1 parent 9370f51 commit 2f35bf6

File tree

3 files changed

+56
-4
lines changed

3 files changed

+56
-4
lines changed

test/help/default-test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ External commands:
109109
! ?git branch -D %(branch)
110110
[-] status bindings
111111
View-specific actions
112-
u status-update Stage/unstage chunk or file changes
113-
! status-revert Revert chunk or file changes
114-
M status-merge Merge file using external tool
112+
u status-update Stage/unstage chunk or file changes
113+
! status-revert Revert chunk or file changes
114+
M status-merge Merge file using external tool
115115
External commands:
116116
C !git commit
117117
[-] stage bindings

test/help/user-command-comment-test

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/bin/sh
2+
3+
. libtest.sh
4+
5+
export TIGRC_SYSTEM=does-not-exist
6+
7+
test_case user-command-comment \
8+
--args='status' \
9+
--tigrc="
10+
bind generic : prompt # User comment for a builtin command is not exposed
11+
bind generic , none # User comment does not interfere with a null binding
12+
bind generic u1 !user
13+
bind generic u2 !user # This is a user commentary for a simple user command
14+
bind generic u3 !user 1 2 3 # This is a user commentary for a user command with parameters
15+
bind generic u4 !user command with a long parameter list but no user commentary
16+
" \
17+
--script="
18+
:view-help
19+
" \
20+
<<EXPECTED_HELP_VIEW
21+
Quick reference for tig keybindings:
22+
23+
[-] generic bindings
24+
Misc
25+
: prompt Open the prompt
26+
External commands:
27+
u1 !user
28+
u2 !user This is a user commentary for a simple user command
29+
u3 !user 1 2 3 This is a user commentary for a user command with parameters
30+
u4 !user command with a long parameter list but no user commentary
31+
32+
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
[help] - line 1 of 10 100%
50+
EXPECTED_HELP_VIEW
51+
52+
run_test_cases

test/tigrc/parse-test

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Misc
115115
: prompt Open the prompt
116116
[-] main bindings
117117
Internal commands:
118-
# :/s e a r c h
118+
# :/s e a r c h Toggle option
119119
External commands:
120120
1 !external command
121121
2 @silent command

0 commit comments

Comments
 (0)