(t *testing.T)
| 2172 | } |
| 2173 | |
| 2174 | func TestFileExists(t *testing.T) { |
| 2175 | mockT := new(testing.T) |
| 2176 | True(t, FileExists(mockT, "assertions.go")) |
| 2177 | |
| 2178 | mockT = new(testing.T) |
| 2179 | False(t, FileExists(mockT, "random_file")) |
| 2180 | |
| 2181 | mockT = new(testing.T) |
| 2182 | False(t, FileExists(mockT, "../_codegen")) |
| 2183 | |
| 2184 | var tempFiles []string |
| 2185 | |
| 2186 | link, err := getTempSymlinkPath("assertions.go") |
| 2187 | if err != nil { |
| 2188 | t.Fatal("could not create temp symlink, err:", err) |
| 2189 | } |
| 2190 | tempFiles = append(tempFiles, link) |
| 2191 | mockT = new(testing.T) |
| 2192 | True(t, FileExists(mockT, link)) |
| 2193 | |
| 2194 | link, err = getTempSymlinkPath("non_existent_file") |
| 2195 | if err != nil { |
| 2196 | t.Fatal("could not create temp symlink, err:", err) |
| 2197 | } |
| 2198 | tempFiles = append(tempFiles, link) |
| 2199 | mockT = new(testing.T) |
| 2200 | True(t, FileExists(mockT, link)) |
| 2201 | |
| 2202 | errs := cleanUpTempFiles(tempFiles) |
| 2203 | if len(errs) > 0 { |
| 2204 | t.Fatal("could not clean up temporary files") |
| 2205 | } |
| 2206 | } |
| 2207 | |
| 2208 | func TestNoFileExists(t *testing.T) { |
| 2209 | mockT := new(testing.T) |
nothing calls this directly
no test coverage detected