fix(cd): harden zoxide directory suggestions
This commit is contained in:
+17
-1
@@ -173,6 +173,23 @@ func TestLookup_NvimFileGenerator(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestQuoteSuggestionArgument(t *testing.T) {
|
||||
tests := map[string]string{
|
||||
"/tmp/project": "/tmp/project",
|
||||
"/tmp/Проект": "/tmp/Проект",
|
||||
"/tmp/My Project": `'/tmp/My Project'`,
|
||||
"/tmp/$Project`command`": "'/tmp/$Project`command`'",
|
||||
`/tmp/quote"and'apostrophe`: "'/tmp/quote\"and'\\''apostrophe'",
|
||||
"~/My Project": `~/'My Project'`,
|
||||
}
|
||||
|
||||
for input, want := range tests {
|
||||
if got := quoteSuggestionArgument(input); got != want {
|
||||
t.Errorf("quoteSuggestionArgument(%q) = %q, want %q", input, got, want)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestLookup_OptionAndFilePriority(t *testing.T) {
|
||||
ResetRegistry()
|
||||
Register(&Spec{
|
||||
@@ -389,4 +406,3 @@ func TestLookup_RealGitProvider(t *testing.T) {
|
||||
t.Errorf("expected 'git recent' in results for real GitProvider, got %v", results)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user