Add tests for - and label args

This commit is contained in:
Azeem Sajid 2025-02-25 17:58:51 +05:00
parent 8ace163608
commit 3d726c9865

View file

@ -72,7 +72,19 @@ func TestGlobPaths(t *testing.T) {
wantErr: nil,
},
{
name: "When no files match, it returns an empty expansions array, it returns the unmatched patterns",
name: "When - is passed, return -",
patterns: []string{"-"},
wantOut: []string{"-"},
wantErr: nil,
},
{
name: "When labels are passed, return labels",
patterns: []string{"file.txt#Text File", "README.md#README"},
wantOut: []string{"file.txt#Text File", "README.md#README"},
wantErr: nil,
},
{
name: "When no files match, it returns an empty expansions array with error",
patterns: []string{"foo"},
wantOut: []string{},
wantErr: errors.New("no matches found for `foo`"),