(t *testing.T)
| 2043 | } |
| 2044 | |
| 2045 | func TestFileExists(t *testing.T) { |
| 2046 | mockT := new(testing.T) |
| 2047 | True(t, FileExists(mockT, "assertions.go")) |
| 2048 | |
| 2049 | mockT = new(testing.T) |
| 2050 | False(t, FileExists(mockT, "random_file")) |
| 2051 | |
| 2052 | mockT = new(testing.T) |
| 2053 | False(t, FileExists(mockT, "../_codegen")) |
| 2054 | |
| 2055 | var tempFiles []string |
| 2056 | |
| 2057 | link, err := getTempSymlinkPath("assertions.go") |
| 2058 | if err != nil { |
| 2059 | t.Fatal("could not create temp symlink, err:", err) |
| 2060 | } |
| 2061 | tempFiles = append(tempFiles, link) |
| 2062 | mockT = new(testing.T) |
| 2063 | True(t, FileExists(mockT, link)) |
| 2064 | |
| 2065 | link, err = getTempSymlinkPath("non_existent_file") |
| 2066 | if err != nil { |
| 2067 | t.Fatal("could not create temp symlink, err:", err) |
| 2068 | } |
| 2069 | tempFiles = append(tempFiles, link) |
| 2070 | mockT = new(testing.T) |
| 2071 | True(t, FileExists(mockT, link)) |
| 2072 | |
| 2073 | errs := cleanUpTempFiles(tempFiles) |
| 2074 | if len(errs) > 0 { |
| 2075 | t.Fatal("could not clean up temporary files") |
| 2076 | } |
| 2077 | } |
| 2078 | |
| 2079 | func TestNoFileExists(t *testing.T) { |
| 2080 | mockT := new(testing.T) |
nothing calls this directly
no test coverage detected
searching dependent graphs…