MCPcopy Create free account
hub / github.com/cloudreve/cloudreve / TestCreatNestedFile

Function TestCreatNestedFile

pkg/util/io_test.go:14–32  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

12}
13
14func TestCreatNestedFile(t *testing.T) {
15 asserts := assert.New(t)
16
17 // 父目录不存在
18 {
19 file, err := CreatNestedFile("test/nest.txt")
20 asserts.NoError(err)
21 asserts.NoError(file.Close())
22 asserts.FileExists("test/nest.txt")
23 }
24
25 // 父目录存在
26 {
27 file, err := CreatNestedFile("test/direct.txt")
28 asserts.NoError(err)
29 asserts.NoError(file.Close())
30 asserts.FileExists("test/direct.txt")
31 }
32}
33
34func TestIsEmpty(t *testing.T) {
35 asserts := assert.New(t)

Callers

nothing calls this directly

Calls 3

CreatNestedFileFunction · 0.85
NewMethod · 0.65
CloseMethod · 0.65

Tested by

no test coverage detected