| 1 | package testscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/ |
| 2 | |
| 3 | import ( |
| 4 | "fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/" |
| 5 | "osscip-go gomod github.com/golang/go/src go1.25.0 os/" |
| 6 | "strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/" |
| 7 | "testingscip-go gomod github.com/golang/go/src go1.25.0 testing/" |
| 8 | |
| 9 | . "github.com/go-git/go-billy/v6scip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/" //nolint |
| 10 | "github.com/go-git/go-billy/v6/utilscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/" |
| 11 | "github.com/stretchr/testify/assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/" |
| 12 | "github.com/stretchr/testify/requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/" |
| 13 | ) |
| 14 | |
| 15 | type dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS# interface { |
| 16 | Basicscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic# |
| 17 | Dirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir# |
| 18 | } |
| 19 | |
| 20 | func eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, test func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#)) { |
| 21 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 22 | for _, fs := range allFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/allFS().(t.TempDirscip-go gomod github.com/golang/go/src go1.25.0 testing/common#TempDir().) { |
| 23 | t.Runscip-go gomod github.com/golang/go/src go1.25.0 testing/T#Run().(fmtscip-go gomod github.com/golang/go/src go1.25.0 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.25.0 fmt/Sprintf().("%T", fs), func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 24 | test(t, fs) |
| 25 | }) |
| 26 | } |
| 27 | } |
| 28 | |
| 29 | func TestDir_MkdirAllscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_MkdirAll().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 30 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 31 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 32 | err := fs.MkdirAllscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#MkdirAll.("empty", osscip-go gomod github.com/golang/go/src go1.25.0 os/.FileModescip-go gomod github.com/golang/go/src go1.25.0 os/FileMode#(0o755)) |
| 33 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 34 | |
| 35 | fi, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("empty") |
| 36 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 37 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, fi.IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#IsDir().()) |
| 38 | }) |
| 39 | } |
| 40 | |
| 41 | func TestDir_MkdirAllNestedscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_MkdirAllNested().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 42 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 43 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 44 | err := fs.MkdirAllscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#MkdirAll.("foo/bar/baz", osscip-go gomod github.com/golang/go/src go1.25.0 os/.FileModescip-go gomod github.com/golang/go/src go1.25.0 os/FileMode#(0o755)) |
| 45 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 46 | |
| 47 | fi, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("foo/bar/baz") |
| 48 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 49 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, fi.IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#IsDir().()) |
| 50 | |
| 51 | fi, err = fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("foo/bar") |
| 52 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 53 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, fi.IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#IsDir().()) |
| 54 | |
| 55 | fi, err = fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("foo") |
| 56 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 57 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, fi.IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#IsDir().()) |
| 58 | }) |
| 59 | } |
| 60 | |
| 61 | func TestDir_MkdirAllIdempotentscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_MkdirAllIdempotent().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 62 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 63 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 64 | err := fs.MkdirAllscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#MkdirAll.("empty", 0o755) |
| 65 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 66 | fi, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("empty") |
| 67 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 68 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, fi.IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#IsDir().()) |
| 69 | |
| 70 | // idempotent |
| 71 | err = fs.MkdirAllscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#MkdirAll.("empty", 0o755) |
| 72 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 73 | fi, err = fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("empty") |
| 74 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 75 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, fi.IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#IsDir().()) |
| 76 | }) |
| 77 | } |
| 78 | |
| 79 | func TestDir_MkdirAllAndCreatescip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_MkdirAllAndCreate().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 80 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 81 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 82 | err := fs.MkdirAllscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#MkdirAll.("dir", osscip-go gomod github.com/golang/go/src go1.25.0 os/.FileModescip-go gomod github.com/golang/go/src go1.25.0 os/FileMode#(0o755)) |
| 83 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 84 | |
| 85 | f, err := fs.Createscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Create.("dir/bar/foo") |
| 86 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 87 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, f.Closescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/File#Close().()) |
| 88 | |
| 89 | fi, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("dir/bar/foo") |
| 90 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 91 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/False().(t, fi.IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#IsDir().()) |
| 92 | }) |
| 93 | } |
| 94 | |
| 95 | func TestDir_MkdirAllWithExistingFilescip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_MkdirAllWithExistingFile().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 96 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 97 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 98 | f, err := fs.Createscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Create.("dir/foo") |
| 99 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 100 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, f.Closescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/File#Close().()) |
| 101 | |
| 102 | err = fs.MkdirAllscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#MkdirAll.("dir/foo", osscip-go gomod github.com/golang/go/src go1.25.0 os/.FileModescip-go gomod github.com/golang/go/src go1.25.0 os/FileMode#(0o755)) |
| 103 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Errorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Error().(t, err) |
| 104 | |
| 105 | fi, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("dir/foo") |
| 106 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 107 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/False().(t, fi.IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#IsDir().()) |
| 108 | }) |
| 109 | } |
| 110 | |
| 111 | func TestDir_StatDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_StatDir().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 112 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 113 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 114 | err := fs.MkdirAllscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#MkdirAll.("foo/bar", 0o755) |
| 115 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 116 | |
| 117 | fi, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("foo/bar") |
| 118 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 119 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, fi.Namescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#Name().(), "bar") |
| 120 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, fi.Modescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#Mode().().IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileMode#IsDir().()) |
| 121 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/False().(t, fi.ModTimescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#ModTime().().IsZeroscip-go gomod github.com/golang/go/src go1.25.0 time/Time#IsZero().()) |
| 122 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, fi.IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#IsDir().()) |
| 123 | }) |
| 124 | } |
| 125 | |
| 126 | func TestDir_StatDeepscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_StatDeep().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 127 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 128 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 129 | files := []string{"foo", "bar", "qux/baz", "qux/qux"} |
| 130 | for _, name := range files { |
| 131 | err := utilscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/.WriteFilescip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/WriteFile().(fs, name, nil, 0o644) |
| 132 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 133 | } |
| 134 | |
| 135 | // Some implementations detect directories based on a prefix |
| 136 | // for all files; it's easy to miss path separator handling there. |
| 137 | fi, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("qu") |
| 138 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.ErrorIsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/ErrorIs().(t, err, osscip-go gomod github.com/golang/go/src go1.25.0 os/.ErrNotExistscip-go gomod github.com/golang/go/src go1.25.0 os/ErrNotExist.) |
| 139 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, fi) |
| 140 | |
| 141 | fi, err = fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("qux") |
| 142 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 143 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, fi.Namescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#Name().(), "qux") |
| 144 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, fi.IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#IsDir().()) |
| 145 | |
| 146 | fi, err = fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("qux/baz") |
| 147 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 148 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, fi.Namescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#Name().(), "baz") |
| 149 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/False().(t, fi.IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#IsDir().()) |
| 150 | }) |
| 151 | } |
| 152 | |
| 153 | func TestDir_ReadDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_ReadDir().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 154 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 155 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 156 | files := []string{"foo", "bar", "qux/baz", "qux/qux"} |
| 157 | for _, name := range files { |
| 158 | err := utilscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/.WriteFilescip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/WriteFile().(fs, name, nil, 0o644) |
| 159 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 160 | } |
| 161 | |
| 162 | info, err := fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#ReadDir.("/") |
| 163 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 164 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, info, 3) |
| 165 | |
| 166 | info, err = fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#ReadDir.("/qux") |
| 167 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 168 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, info, 2) |
| 169 | }) |
| 170 | } |
| 171 | |
| 172 | func TestDir_ReadDirNestedscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_ReadDirNested().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 173 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 174 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 175 | maxNestedDirs := 100 |
| 176 | path := "/" |
| 177 | for i := 0; i <= maxNestedDirs; i++ { |
| 178 | path = fs.Joinscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Join.(path, strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.Itoascip-go gomod github.com/golang/go/src go1.25.0 strconv/Itoa().(i)) |
| 179 | } |
| 180 | |
| 181 | files := []string{fs.Joinscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Join.(path, "f1"), fs.Joinscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Join.(path, "f2")} |
| 182 | for _, name := range files { |
| 183 | err := utilscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/.WriteFilescip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/WriteFile().(fs, name, nil, 0o644) |
| 184 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 185 | } |
| 186 | |
| 187 | path = "/" |
| 188 | for i := range maxNestedDirs { |
| 189 | path = fs.Joinscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Join.(path, strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.Itoascip-go gomod github.com/golang/go/src go1.25.0 strconv/Itoa().(i)) |
| 190 | info, err := fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#ReadDir.(path) |
| 191 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 192 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, info, 1) |
| 193 | } |
| 194 | |
| 195 | path = fs.Joinscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Join.(path, strconvscip-go gomod github.com/golang/go/src go1.25.0 strconv/.Itoascip-go gomod github.com/golang/go/src go1.25.0 strconv/Itoa().(maxNestedDirs)) |
| 196 | info, err := fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#ReadDir.(path) |
| 197 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 198 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, info, 2) |
| 199 | }) |
| 200 | } |
| 201 | |
| 202 | func TestDir_ReadDirWithMkDirAllscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_ReadDirWithMkDirAll().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 203 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 204 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 205 | err := fs.MkdirAllscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#MkdirAll.("qux", 0o755) |
| 206 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 207 | |
| 208 | files := []string{"qux/baz", "qux/qux"} |
| 209 | for _, name := range files { |
| 210 | err := utilscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/.WriteFilescip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/WriteFile().(fs, name, nil, 0o644) |
| 211 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 212 | } |
| 213 | |
| 214 | info, err := fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#ReadDir.("/") |
| 215 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 216 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, info, 1) |
| 217 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, info[0].IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/DirEntry#IsDir().()) |
| 218 | |
| 219 | info, err = fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#ReadDir.("/qux") |
| 220 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 221 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, info, 2) |
| 222 | }) |
| 223 | } |
| 224 | |
| 225 | func TestDir_ReadDirFileInfoscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_ReadDirFileInfo().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 226 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 227 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 228 | err := utilscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/.WriteFilescip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/WriteFile().(fs, "foo", []byte{'F', 'O', 'O'}, 0o644) |
| 229 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 230 | |
| 231 | info, err := fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#ReadDir.("/") |
| 232 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 233 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, info, 1) |
| 234 | |
| 235 | fi, err := info[0].Infoscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/DirEntry#Info().() |
| 236 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 237 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, fi.Sizescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#Size().(), int64(3)) |
| 238 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/False().(t, info[0].IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/DirEntry#IsDir().()) |
| 239 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, info[0].Namescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/DirEntry#Name().(), "foo") |
| 240 | }) |
| 241 | } |
| 242 | |
| 243 | func TestDir_ReadDirFileInfoDirsscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_ReadDirFileInfoDirs().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 244 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 245 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 246 | files := []string{"qux/baz/foo"} |
| 247 | for _, name := range files { |
| 248 | err := utilscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/.WriteFilescip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/WriteFile().(fs, name, []byte{'F', 'O', 'O'}, 0o644) |
| 249 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 250 | } |
| 251 | |
| 252 | info, err := fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#ReadDir.("qux") |
| 253 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 254 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, info, 1) |
| 255 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Truescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/True().(t, info[0].IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/DirEntry#IsDir().()) |
| 256 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, "baz", info[0].Namescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/DirEntry#Name().()) |
| 257 | |
| 258 | info, err = fs.ReadDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#ReadDir.("qux/baz") |
| 259 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 260 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Lenscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Len().(t, info, 1) |
| 261 | |
| 262 | fi, err := info[0].Infoscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/DirEntry#Info().() |
| 263 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 264 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, fi.Sizescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#Size().(), int64(3)) |
| 265 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Falsescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/False().(t, info[0].IsDirscip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/DirEntry#IsDir().()) |
| 266 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, info[0].Namescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/DirEntry#Name().(), "foo") |
| 267 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotEqualscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotEqual().(t, fi.Modescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#Mode().(), 0) |
| 268 | }) |
| 269 | } |
| 270 | |
| 271 | func TestDir_RenameToDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_RenameToDir().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 272 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 273 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 274 | err := utilscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/.WriteFilescip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/WriteFile().(fs, "foo", nil, 0o644) |
| 275 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 276 | |
| 277 | err = fs.Renamescip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Rename.("foo", "bar/qux") |
| 278 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 279 | |
| 280 | old, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("foo") |
| 281 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, old) |
| 282 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.ErrorIsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/ErrorIs().(t, err, osscip-go gomod github.com/golang/go/src go1.25.0 os/.ErrNotExistscip-go gomod github.com/golang/go/src go1.25.0 os/ErrNotExist.) |
| 283 | |
| 284 | dir, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("bar") |
| 285 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, dir) |
| 286 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 287 | |
| 288 | file, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("bar/qux") |
| 289 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Equalscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Equal().(t, file.Namescip-go gomod github.com/golang/go/src go1.25.0 `io/fs`/FileInfo#Name().(), "qux") |
| 290 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 291 | }) |
| 292 | } |
| 293 | |
| 294 | func TestDir_RenameDirscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/TestDir_RenameDir().(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#) { |
| 295 | eachDirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/eachDirFS().(t, func(t *testingscip-go gomod github.com/golang/go/src go1.25.0 testing/.Tscip-go gomod github.com/golang/go/src go1.25.0 testing/T#, fs dirFSscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/test`/dirFS#) { |
| 296 | t.Helperscip-go gomod github.com/golang/go/src go1.25.0 testing/common#Helper().() |
| 297 | err := fs.MkdirAllscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Dir#MkdirAll.("foo", 0o755) |
| 298 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 299 | |
| 300 | err = utilscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/.WriteFilescip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6/util`/WriteFile().(fs, "foo/bar", nil, 0o644) |
| 301 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 302 | |
| 303 | err = fs.Renamescip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Rename.("foo", "bar") |
| 304 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 305 | |
| 306 | dirfoo, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("foo") |
| 307 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, dirfoo) |
| 308 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.ErrorIsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/ErrorIs().(t, err, osscip-go gomod github.com/golang/go/src go1.25.0 os/.ErrNotExistscip-go gomod github.com/golang/go/src go1.25.0 os/ErrNotExist.) |
| 309 | |
| 310 | dirbar, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("bar") |
| 311 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 312 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, dirbar) |
| 313 | |
| 314 | foo, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("foo/bar") |
| 315 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.ErrorIsscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/ErrorIs().(t, err, osscip-go gomod github.com/golang/go/src go1.25.0 os/.ErrNotExistscip-go gomod github.com/golang/go/src go1.25.0 os/ErrNotExist.) |
| 316 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.Nilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/Nil().(t, foo) |
| 317 | |
| 318 | bar, err := fs.Statscip-go gomod github.com/go-git/go-billy/v6 . `github.com/go-git/go-billy/v6`/Basic#Stat.("bar/bar") |
| 319 | requirescip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/.NoErrorscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/require`/NoError().(t, err) |
| 320 | assertscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/.NotNilscip-go gomod github.com/stretchr/testify v1.11.1 `github.com/stretchr/testify/assert`/NotNil().(t, bar) |
| 321 | }) |
| 322 | } |