(t *testing.T)
| 660 | } |
| 661 | |
| 662 | func 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 | } |
nothing calls this directly
no test coverage detected