Skip to content

Commit 5f3b9bf

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 b8cf73c commit 5f3b9bf

File tree

3 files changed

+57
-4
lines changed

3 files changed

+57
-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: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
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+
:bind generic p1 !true
19+
:view-help
20+
" \
21+
<<EXPECTED_HELP_VIEW
22+
Quick reference for tig keybindings:
23+
24+
[-] generic bindings
25+
Misc
26+
: prompt Open the prompt
27+
External commands:
28+
u1 !user
29+
u2 !user This is a user commentary for a simple user command
30+
u3 !user 1 2 3 This is a user commentary for a user command with parameters
31+
u4 !user command with a long parameter list but no user commentary
32+
p1 !true
33+
34+
35+
36+
37+
38+
39+
40+
41+
42+
43+
44+
45+
46+
47+
48+
49+
50+
[help] - line 1 of 11 100%
51+
EXPECTED_HELP_VIEW
52+
53+
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)