MCPcopy Create free account
hub / github.com/github/gh-aw / TestIsRunnable_FileErrors

Function TestIsRunnable_FileErrors

pkg/cli/commands_utils_test.go:662–699  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

660}
661
662func TestIsRunnable_FileErrors(t *testing.T) {
663 tests := []struct {
664 name string
665 filePath string
666 expectErr bool
667 }{
668 {
669 name: "nonexistent file",
670 filePath: "/nonexistent/path/workflow.md",
671 expectErr: true,
672 },
673 {
674 name: "empty file path",
675 filePath: "",
676 expectErr: true,
677 },
678 }
679
680 for _, tt := range tests {
681 t.Run(tt.name, func(t *testing.T) {
682 result, err := IsRunnable(tt.filePath)
683
684 if tt.expectErr {
685 if err == nil {
686 t.Errorf("Expected error but got none")
687 }
688 // Result should be false when there's an error
689 if result {
690 t.Errorf("Expected false result on error, got true")
691 }
692 } else {
693 if err != nil {
694 t.Errorf("Unexpected error: %v", err)
695 }
696 }
697 })
698 }
699}

Callers

nothing calls this directly

Calls 3

IsRunnableFunction · 0.85
RunMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected