mirror of
https://github.com/go-task/task.git
synced 2025-06-23 00:38:19 +02:00
fix: exclude other "ignored" files. (#1356)
This commit is contained in:
@ -6,6 +6,7 @@ package task_test
|
||||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
@ -79,3 +80,21 @@ Hello, World!
|
||||
err = os.RemoveAll(filepathext.SmartJoin(dir, "src"))
|
||||
require.NoError(t, err)
|
||||
}
|
||||
|
||||
func TestShouldIgnoreFile(t *testing.T) {
|
||||
tt := []struct {
|
||||
path string
|
||||
expect bool
|
||||
}{
|
||||
{"/.git/hooks", true},
|
||||
{"/.github/workflows/build.yaml", false},
|
||||
}
|
||||
|
||||
for k, ct := range tt {
|
||||
ct := ct
|
||||
t.Run(fmt.Sprintf("ignore - %d", k), func(t *testing.T) {
|
||||
t.Parallel()
|
||||
require.Equal(t, shouldIgnoreFile(ct.path), ct.expect)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user