Files
qvyun/backend/main_test.go
2025-01-15 10:43:16 +08:00

27 lines
479 B
Go

package main
import (
"os"
"path/filepath"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func Test_mkdir(t *testing.T) {
Convey("Test os.MkdirAll", t, func() {
path := filepath.Join(os.TempDir(), "abc")
defer os.RemoveAll(path)
Convey("first create a directory", func() {
err := os.MkdirAll(path, 0o755)
So(err, ShouldBeNil)
})
Convey("create a directory again", func() {
err := os.MkdirAll(path, 0o755)
So(err, ShouldBeNil)
})
})
}