@@ -107,6 +107,34 @@ load 'util/init.sh'
107
107
assert [ " $( readlink " $BPM_INSTALL_COMPLETIONS /bash/c4.bash" ) " = " $BPM_PACKAGES_PATH /$site /$pkg /contrib/completions/c4.bash" ]
108
108
}
109
109
110
+ @test " adds bash completions determined with heuristics (share/etc)" {
111
+ local site=' github.com'
112
+ local pkg=' username/package'
113
+
114
+ test_util.setup_pkg " $pkg " ; {
115
+ mkdir -p ' share/bash-completion/completions'
116
+ mkdir -p ' etc/bash_completion.d'
117
+
118
+ touch ' share/bash-completion/completions/c1'
119
+ touch ' share/bash-completion/completions/c2.sh'
120
+ touch ' share/bash-completion/completions/c3.bash'
121
+ touch ' etc/bash_completion.d/c4'
122
+ touch ' etc/bash_completion.d/c5.sh'
123
+ touch ' etc/bash_completion.d/c6.bash'
124
+ }; test_util.finish_pkg
125
+ test_util.fake_add " $pkg "
126
+
127
+ run do-plumbing-link-completions " $site /$pkg "
128
+
129
+ assert_success
130
+ assert [ " $( readlink " $BPM_INSTALL_COMPLETIONS /bash/c1.bash" ) " = " $BPM_PACKAGES_PATH /$site /$pkg /share/bash-completion/completions/c1" ]
131
+ assert [ " $( readlink " $BPM_INSTALL_COMPLETIONS /bash/c2.sh" ) " = " $BPM_PACKAGES_PATH /$site /$pkg /share/bash-completion/completions/c2.sh" ]
132
+ assert [ " $( readlink " $BPM_INSTALL_COMPLETIONS /bash/c3.bash" ) " = " $BPM_PACKAGES_PATH /$site /$pkg /share/bash-completion/completions/c3.bash" ]
133
+ assert [ " $( readlink " $BPM_INSTALL_COMPLETIONS /bash/c4.bash" ) " = " $BPM_PACKAGES_PATH /$site /$pkg /etc/bash_completion.d/c4" ]
134
+ assert [ " $( readlink " $BPM_INSTALL_COMPLETIONS /bash/c5.sh" ) " = " $BPM_PACKAGES_PATH /$site /$pkg /etc/bash_completion.d/c5.sh" ]
135
+ assert [ " $( readlink " $BPM_INSTALL_COMPLETIONS /bash/c6.bash" ) " = " $BPM_PACKAGES_PATH /$site /$pkg /etc/bash_completion.d/c6.bash" ]
136
+ }
137
+
110
138
@test " adds bash completions determined from heuristics when when ZSH_COMPLETIONS is specified in package.sh" {
111
139
local site=' github.com'
112
140
local pkg=" username/package"
0 commit comments