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 18, 2019
1 parent 9370f51 commit 2f35bf6
Show file tree
Hide file tree
Showing 3 changed files with 56 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
52 changes: 52 additions & 0 deletions test/help/user-command-comment-test
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/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="
: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
[help] - line 1 of 10 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 2f35bf6

Please sign in to comment.