(t *testing.T)
| 2128 | } |
| 2129 | |
| 2130 | func TestDirExists(t *testing.T) { |
| 2131 | mockT := new(testing.T) |
| 2132 | False(t, DirExists(mockT, "assertions.go")) |
| 2133 | |
| 2134 | mockT = new(testing.T) |
| 2135 | False(t, DirExists(mockT, "non_existent_dir")) |
| 2136 | |
| 2137 | mockT = new(testing.T) |
| 2138 | True(t, DirExists(mockT, "../assert")) |
| 2139 | |
| 2140 | var tempFiles []string |
| 2141 | |
| 2142 | link, err := getTempSymlinkPath("assertions.go") |
| 2143 | if err != nil { |
| 2144 | t.Fatal("could not create temp symlink, err:", err) |
| 2145 | } |
| 2146 | tempFiles = append(tempFiles, link) |
| 2147 | mockT = new(testing.T) |
| 2148 | False(t, DirExists(mockT, link)) |
| 2149 | |
| 2150 | link, err = getTempSymlinkPath("non_existent_dir") |
| 2151 | if err != nil { |
| 2152 | t.Fatal("could not create temp symlink, err:", err) |
| 2153 | } |
| 2154 | tempFiles = append(tempFiles, link) |
| 2155 | mockT = new(testing.T) |
| 2156 | False(t, DirExists(mockT, link)) |
| 2157 | |
| 2158 | errs := cleanUpTempFiles(tempFiles) |
| 2159 | if len(errs) > 0 { |
| 2160 | t.Fatal("could not clean up temporary files") |
| 2161 | } |
| 2162 | } |
| 2163 | |
| 2164 | func TestNoDirExists(t *testing.T) { |
| 2165 | mockT := new(testing.T) |
nothing calls this directly
no test coverage detected
searching dependent graphs…