MCPcopy
hub / github.com/expr-lang/expr / TestDirExists

Function TestDirExists

internal/testify/assert/assertions_test.go:2130–2162  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2128}
2129
2130func 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
2164func TestNoDirExists(t *testing.T) {
2165 mockT := new(testing.T)

Callers

nothing calls this directly

Calls 5

getTempSymlinkPathFunction · 0.85
cleanUpTempFilesFunction · 0.85
FalseFunction · 0.70
DirExistsFunction · 0.70
TrueFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…