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

Function TestPromptInSummary

executor_test.go:840–875  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

838}
839
840func TestPromptInSummary(t *testing.T) {
841 t.Parallel()
842
843 tests := []struct {
844 name string
845 input string
846 wantError bool
847 }{
848 {"test short approval", "y\n", false},
849 {"test long approval", "yes\n", false},
850 {"test uppercase approval", "Y\n", false},
851 {"test stops task", "n\n", true},
852 {"test junk value stops task", "foobar\n", true},
853 {"test Enter stops task", "\n", true},
854 }
855
856 for _, test := range tests {
857 t.Run(test.name, func(t *testing.T) {
858 t.Parallel()
859
860 opts := []ExecutorTestOption{
861 WithName(test.name),
862 WithExecutorOptions(
863 task.WithDir("testdata/prompt"),
864 task.WithAssumeTerm(true),
865 ),
866 WithTask("foo"),
867 WithInput(test.input),
868 }
869 if test.wantError {
870 opts = append(opts, WithRunError())
871 }
872 NewExecutorTest(t, opts...)
873 })
874 }
875}
876
877func TestPromptWithIndirectTask(t *testing.T) {
878 t.Parallel()

Callers

nothing calls this directly

Calls 7

WithNameFunction · 0.85
WithExecutorOptionsFunction · 0.85
WithTaskFunction · 0.85
WithInputFunction · 0.85
WithRunErrorFunction · 0.85
NewExecutorTestFunction · 0.85
RunMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…