File: source-test

package info (click to toggle)
tig 2.6.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,188 kB
  • sloc: ansic: 36,941; sh: 10,934; makefile: 394
file content (121 lines) | stat: -rwxr-xr-x 2,497 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#!/bin/sh

. libtest.sh

export LINES=10

# Disable built-in configuration
export TIGRC_SYSTEM=does-not-exist

file "$HOME/.tigrc.bind.q.for.help.screen" <<EOF
bind generic q quit
EOF

test_case source-file-plain \
	--args='status' \
	--tigrc="
		bind generic : prompt
		source $HOME/.tigrc.bind.q.for.help.screen
		" \
	--script="
		:view-help
		" \
	<<EOF
Quick reference for tig keybindings:
[-] Collapse all sections

[-] generic bindings
View manipulation
  q quit   Close all views and quit
Misc
  : prompt Open the prompt
[help] - line 1 of 28                                                        28%
EOF

test_case source-file-quietly \
	--args='status' \
	--tigrc="
		bind generic : prompt
		source -q $HOME/.tigrc.bind.q.for.help.screen
		" \
	--script="
		:view-help
		" \
	<<EOF
Quick reference for tig keybindings:
[-] Collapse all sections

[-] generic bindings
View manipulation
  q quit   Close all views and quit
Misc
  : prompt Open the prompt
[help] - line 1 of 28                                                        28%
EOF

test_case source-nonexistent-file \
	--args='status' \
	--tigrc="
		bind generic : prompt
		source $HOME/.tigrc.nonexistent.file
		" \
	--script="
		:view-help
		" \
	--assert-stderr="tig warning: ~/.tigrc:3: File does not exist: HOME/.tigrc.nonexistent.file
tig warning: Errors while loading HOME/.tigrc." \
	<<EOF
Quick reference for tig keybindings:
[-] Collapse all sections

[-] generic bindings
Misc
  : prompt Open the prompt
[-] toggle bindings
Toggle keys (enter: o <key>):
[help] - line 1 of 26                                                        30%
EOF

test_case source-nonexistent-file-quietly \
	--args='status' \
	--tigrc="
		bind generic : prompt
		source -q $HOME/.tigrc.nonexistent.file
		" \
	--script="
		:view-help
		" \
	<<EOF
Quick reference for tig keybindings:
[-] Collapse all sections

[-] generic bindings
Misc
  : prompt Open the prompt
[-] toggle bindings
Toggle keys (enter: o <key>):
[help] - line 1 of 26                                                        30%
EOF

test_case source-tilde-path \
	--args='status' \
	--tigrc="
		bind generic : prompt
		source ~/.tigrc.bind.q.for.help.screen
		" \
	--script="
		:view-help
		" \
	<<EOF
Quick reference for tig keybindings:
[-] Collapse all sections

[-] generic bindings
View manipulation
  q quit   Close all views and quit
Misc
  : prompt Open the prompt
[help] - line 1 of 28                                                        28%
EOF

run_test_cases