(t *testing.T)
| 386 | } |
| 387 | |
| 388 | func TestDirMkdir(t *testing.T) { |
| 389 | r, vfs, dir, file1 := dirCreate(t) |
| 390 | |
| 391 | _, err := dir.Mkdir("file1") |
| 392 | assert.Error(t, err) |
| 393 | |
| 394 | origModTime := dir.ModTime() |
| 395 | time.Sleep(100 * time.Millisecond) // for low rez Windows timers |
| 396 | sub, err := dir.Mkdir("sub") |
| 397 | assert.NoError(t, err) |
| 398 | assert.True(t, dir.ModTime().After(origModTime)) |
| 399 | |
| 400 | // check the vfs |
| 401 | checkListing(t, dir, []string{"file1,14,false", "sub,0,true"}) |
| 402 | checkListing(t, sub, []string(nil)) |
| 403 | |
| 404 | // check the underlying r.Fremote |
| 405 | fstest.CheckListingWithPrecision(t, r.Fremote, []fstest.Item{file1}, []string{"dir", "dir/sub"}, r.Fremote.Precision()) |
| 406 | |
| 407 | vfs.Opt.ReadOnly = true |
| 408 | _, err = dir.Mkdir("sausage") |
| 409 | assert.Equal(t, EROFS, err) |
| 410 | } |
| 411 | |
| 412 | func TestDirMkdirSub(t *testing.T) { |
| 413 | r, vfs, dir, file1 := dirCreate(t) |
nothing calls this directly
no test coverage detected
searching dependent graphs…