Test various combinations of setting mod times with and without the cache and with and without opening or writing to the file. Each of these tests a different path through the VFS code.
(t *testing.T)
| 149 | // |
| 150 | // Each of these tests a different path through the VFS code. |
| 151 | func TestFileSetModTime(t *testing.T) { |
| 152 | for _, cacheMode := range []vfscommon.CacheMode{vfscommon.CacheModeOff, vfscommon.CacheModeFull} { |
| 153 | for _, open := range []bool{false, true} { |
| 154 | for _, write := range []bool{false, true} { |
| 155 | if write && !open { |
| 156 | continue |
| 157 | } |
| 158 | t.Run(fmt.Sprintf("cache=%v,open=%v,write=%v", cacheMode, open, write), func(t *testing.T) { |
| 159 | testFileSetModTime(t, cacheMode, open, write) |
| 160 | }) |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | |
| 166 | func fileCheckContents(t *testing.T, file *File) { |
| 167 | fd, err := file.Open(os.O_RDONLY) |
nothing calls this directly
no test coverage detected
searching dependent graphs…