(t *testing.T)
| 58 | } |
| 59 | |
| 60 | func TestRecursiveGetExecutablePaths(t *testing.T) { |
| 61 | dir, err := prepareTestDirTree() |
| 62 | if err != nil { |
| 63 | t.Fatalf("error creating temp directory: %v\n", err) |
| 64 | } |
| 65 | type args struct { |
| 66 | dir string |
| 67 | } |
| 68 | tests := []struct { |
| 69 | name string |
| 70 | args args |
| 71 | want []string |
| 72 | wantErr bool |
| 73 | }{ |
| 74 | { |
| 75 | name: "get executable files", |
| 76 | args: args{ |
| 77 | dir: dir, |
| 78 | }, |
| 79 | want: []string{"aa/exec.py", "check.py"}, |
| 80 | wantErr: false, |
| 81 | }, |
| 82 | } |
| 83 | for _, tt := range tests { |
| 84 | t.Run(tt.name, func(t *testing.T) { |
| 85 | got, err := RecursiveGetExecutablePaths(tt.args.dir) |
| 86 | if (err != nil) != tt.wantErr { |
| 87 | t.Errorf("RecursiveGetExecutablePaths() error = %v, wantErr %v", err, tt.wantErr) |
| 88 | return |
| 89 | } |
| 90 | for i := range got { |
| 91 | if !strings.HasSuffix(got[i], tt.want[i]) { |
| 92 | t.Errorf("RecursiveGetExecutablePaths() got = %v, want %v", got, tt.want) |
| 93 | } |
| 94 | } |
| 95 | }) |
| 96 | } |
| 97 | |
| 98 | os.RemoveAll(dir) |
| 99 | } |
| 100 | |
| 101 | func TestRecursiveCheckLibDirectory(t *testing.T) { |
| 102 | dir, err := prepareTestDirTree() |
nothing calls this directly
no test coverage detected