Add additional test case for when extension is prefixed with a dot

This commit is contained in:
Sam Coe 2025-07-17 17:32:48 +02:00
parent 723d0e861b
commit e2b444452d
No known key found for this signature in database

View file

@ -341,6 +341,24 @@ func TestCodeRun(t *testing.T) {
},
wantBrowse: "https://github.com/search?q=map+path%3Atesting.go&type=code",
},
{
name: "properly handles extension with dot prefix when converting to path qualifier",
opts: &CodeOptions{
Config: func() (gh.Config, error) { return config.NewBlankConfig(), nil },
Query: search.Query{
Keywords: []string{"map"},
Kind: "code",
Limit: 30,
Qualifiers: search.Qualifiers{
Filename: "testing",
Extension: ".cpp",
},
},
Searcher: search.NewSearcher(nil, "github.com"),
WebMode: true,
},
wantBrowse: "https://github.com/search?q=map+path%3Atesting.cpp&type=code",
},
{
name: "does not convert filename and extension qualifiers for GHES web search",
opts: &CodeOptions{