Fix the help tests
[tig.git] / test / tigrc / parse-test
blob26fdc9a5ccac889b58bc2569c38b0e21cd208b26
1 #!/bin/sh
3 # Test tigrc parsing errors.
5 . libtest.sh
7 tigrc <<EOF
8 s # Unknown command
9 set # Missing name, equals and value
10 set ignore-space # Missing equals and value
11 set ignore-space = # Missing value
12 set ignore-space=no # Missing space
13 set something = jada # Unknown settings name
14 set ignore-space = jada # Bad enum value
15 set tab-size = long # Bad int value
16 set split-view-height = half # Bad scale value
17 set split-view-height = 110% # Bad scale value
18 set split-view-height = -10% # Bad scale value
20 bind # Missing map, key and action
21 bind generic # Missing key and action
22 bind generic B # Missing action
23 bind generic # refresh # Must use Hash instead of '#'
25 color # Missing area and colors
26 color file # Missing colors
27 color grep.file # Missing colors
28 color file green # Missing fg color
29 color file green bold # Attribute used as fg color
30 color file dark green # Unknown color
31 color file green dark # Unknown color
32 color file green green normally # Unknown attribute
34 # Test that lines continue correctly \\
35 ignored \\
37 set main-view = \\
38 line-number \\
39 commit-title # Multi-line option
41 set main_view_line_number_visibility = yes
43 bind generic " edit
44 bind generic ' options
45 bind generic " @sh -c "echo %(commit) | pbcopy"
46 bind generic ' !sh -c 'git | tig'
48 bind generic : prompt # Must have prompt mapping
49 bind generic ø view-tree # Binding to UTF-8 keys
50 bind main <Hash> :/s e a r c h # Toggle option
51 bind main 1 !external command
52 bind main 2 @silent command
53 bind main 3 ?prompted command
54 bind main 4 <quitting command
55 bind main 0 !@?<all modifiers
57 # Non-ending multi-line command
58 c\\
59 o\\
60 l\\
61 o\\
62 r\\
63 EOF
65 steps "
66 :view-help
67 :save-display help.screen
70 TIGRC_SYSTEM="should-not-be-loaded"
72 test_tig status
74 assert_equals stderr <<EOF
75 tig warning: ~/.tigrc:1: Unknown option command: s
76 tig warning: ~/.tigrc:2: Invalid set command: set option = value
77 tig warning: ~/.tigrc:3: Invalid set command: set option = value
78 tig warning: ~/.tigrc:4: Invalid set command: set option = value
79 tig warning: ~/.tigrc:5: Invalid set command: set option = value
80 tig warning: ~/.tigrc:6: Unknown option name: something
81 tig warning: ~/.tigrc:7: 'jada' is not a valid value for ignore-space; using no
82 tig warning: ~/.tigrc:8: Value must be between 1 and 1024
83 tig warning: ~/.tigrc:9: Invalid double or percentage
84 tig warning: ~/.tigrc:10: Percentage is larger than 100%
85 tig warning: ~/.tigrc:11: Percentage is less than 0%
86 tig warning: ~/.tigrc:13: Invalid key binding: bind keymap key action
87 tig warning: ~/.tigrc:14: Invalid key binding: bind keymap key action
88 tig warning: ~/.tigrc:15: Invalid key binding: bind keymap key action
89 tig warning: ~/.tigrc:16: Invalid key binding: bind keymap key action
90 tig warning: ~/.tigrc:18: Invalid color mapping: color area fgcolor bgcolor [attrs]
91 tig warning: ~/.tigrc:19: Invalid color mapping: color area fgcolor bgcolor [attrs]
92 tig warning: ~/.tigrc:20: Invalid color mapping: color area fgcolor bgcolor [attrs]
93 tig warning: ~/.tigrc:21: Invalid color mapping: color area fgcolor bgcolor [attrs]
94 tig warning: ~/.tigrc:22: Unknown color: bold
95 tig warning: ~/.tigrc:23: Unknown color: dark
96 tig warning: ~/.tigrc:24: Unknown color: dark
97 tig warning: ~/.tigrc:25: Unknown color attribute: normally
98 tig warning: ~/.tigrc:34: Unknown option \`visibility' for column line-number
99 tig warning: ~/.tigrc:36: Invalid key binding: bind keymap key action
100 tig warning: ~/.tigrc:37: Invalid key binding: bind keymap key action
101 tig warning: ~/.tigrc:38: Unknown command flag '%'; expected one of :!?@<
102 tig warning: ~/.tigrc:39: Unknown command flag '|'; expected one of :!?@<
103 tig warning: ~/.tigrc:56: Unknown option command: c
104 tig warning: Errors while loading HOME/.tigrc.
107 assert_equals help.screen <<EOF
108 Quick reference for tig keybindings:
110 [-] generic bindings
111 View switching
112 ø view-tree Show tree view
113 Misc
114 : prompt Open the prompt
115 [-] main bindings
116 Internal commands:
117 # :/s e a r c h
118 External commands:
119 1 !external command
120 2 @silent command
121 3 ?prompted command
122 4 <quitting command
123 0 @?<all modifiers
136 [help] - line 1 of 16 100%