File: source-test

package info (click to toggle)
tig 2.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 5,388 kB
  • sloc: ansic: 32,985; sh: 10,118; makefile: 389
file content (116 lines) | stat: -rwxr-xr-x 2,263 bytes parent folder | download | duplicates (4)
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
#!/bin/sh

. libtest.sh

LINES=9

# 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:

[-] generic bindings
View manipulation
  q quit   Close all views and quit
Misc
  : prompt Open the prompt
[help] - line 1 of 7                                                        100%
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:

[-] generic bindings
View manipulation
  q quit   Close all views and quit
Misc
  : prompt Open the prompt
[help] - line 1 of 7                                                        100%
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:

[-] generic bindings
Misc
  : prompt Open the prompt


[help] - line 1 of 5                                                        100%
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:

[-] generic bindings
Misc
  : prompt Open the prompt


[help] - line 1 of 5                                                        100%
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:

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

run_test_cases