(t *testing.T)
| 40 | } |
| 41 | |
| 42 | func TestFileExists(t *testing.T) { |
| 43 | content := []byte("my file content") |
| 44 | f, cleanup := newFile(t, content) |
| 45 | defer cleanup() |
| 46 | |
| 47 | type args struct { |
| 48 | path string |
| 49 | } |
| 50 | tests := []struct { |
| 51 | name string |
| 52 | args args |
| 53 | want bool |
| 54 | }{ |
| 55 | {"ok", args{f.Name()}, true}, |
| 56 | {"nok", args{f.Name() + ".foo"}, false}, |
| 57 | {"empty", args{""}, false}, |
| 58 | } |
| 59 | for _, tt := range tests { |
| 60 | t.Run(tt.name, func(t *testing.T) { |
| 61 | if got := FileExists(tt.args.path); got != tt.want { |
| 62 | t.Errorf("FileExists() = %v, want %v", got, tt.want) |
| 63 | } |
| 64 | }) |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | func TestReadAll(t *testing.T) { |
| 69 | content := []byte("read all this") |
nothing calls this directly
no test coverage detected
searching dependent graphs…