Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
stevenyvr987 committed May 20, 2019
1 parent b8cf73c commit 5f3b9bf
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 4 deletions.
6 changes: 3 additions & 3 deletions test/help/default-test
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,9 @@ External commands:
! ?git branch -D %(branch)
[-] status bindings
View-specific actions
u status-update Stage/unstage chunk or file changes
! status-revert Revert chunk or file changes
M status-merge Merge file using external tool
u status-update Stage/unstage chunk or file changes
! status-revert Revert chunk or file changes
M status-merge Merge file using external tool
External commands:
C !git commit
[-] stage bindings
Expand Down
53 changes: 53 additions & 0 deletions test/help/user-command-comment-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#!/bin/sh

. libtest.sh

export TIGRC_SYSTEM=does-not-exist

test_case user-command-comment \
--args='status' \
--tigrc="
bind generic : prompt # User comment for a builtin command is not exposed
bind generic , none # User comment does not interfere with a null binding
bind generic u1 !user
bind generic u2 !user # This is a user commentary for a simple user command
bind generic u3 !user 1 2 3 # This is a user commentary for a user command with parameters
bind generic u4 !user command with a long parameter list but no user commentary
" \
--script="
:bind generic p1 !true
:view-help
" \
<<EXPECTED_HELP_VIEW
Quick reference for tig keybindings:
[-] generic bindings
Misc
: prompt Open the prompt
External commands:
u1 !user
u2 !user This is a user commentary for a simple user command
u3 !user 1 2 3 This is a user commentary for a user command with parameters
u4 !user command with a long parameter list but no user commentary
p1 !true
[help] - line 1 of 11 100%
EXPECTED_HELP_VIEW

run_test_cases
2 changes: 1 addition & 1 deletion test/tigrc/parse-test
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ Misc
: prompt Open the prompt
[-] main bindings
Internal commands:
# :/s e a r c h
# :/s e a r c h Toggle option
External commands:
1 !external command
2 @silent command
Expand Down

0 comments on commit 5f3b9bf

Please sign in to comment.