MCPcopy
hub / github.com/go-task/task / TestGitignoreTaskListFallback

Function TestGitignoreTaskListFallback

task_test.go:791–812  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

789}
790
791func TestGitignoreTaskListFallback(t *testing.T) { //nolint:paralleltest // shares testdata/gitignore with TestGitignoreChecksum
792 const dir = "testdata/gitignore"
793
794 var buff bytes.Buffer
795 e := task.NewExecutor(
796 task.WithDir(dir),
797 task.WithStdout(&buff),
798 task.WithStderr(&buff),
799 )
800 require.NoError(t, e.Setup())
801
802 listed, err := e.CompiledTaskForTaskList(&task.Call{Task: "build"})
803 require.NoError(t, err)
804 assert.True(t, listed.ShouldUseGitignore(),
805 "task list should reflect the global use_gitignore fallback")
806
807 // "build-no-use_gitignore" explicitly disables it.
808 listedOff, err := e.CompiledTaskForTaskList(&task.Call{Task: "build-no-use_gitignore"})
809 require.NoError(t, err)
810 assert.False(t, listedOff.ShouldUseGitignore(),
811 "explicit use_gitignore: false must be preserved in the list path")
812}
813
814func TestStatusVariables(t *testing.T) {
815 t.Parallel()

Callers

nothing calls this directly

Calls 3

SetupMethod · 0.95
ShouldUseGitignoreMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…