commit f46a027f178c3d0a2f5a56c789e912c439bf25c7
parent 25e63b5b1f07973b3030f5cc7d3c6ae37f5df3d2
Author: Matsuda Kenji <info@mtkn.jp>
Date: Thu, 19 Oct 2023 10:30:03 +0900
update testFS
Diffstat:
2 files changed, 16 insertions(+), 15 deletions(-)
diff --git a/server_test.go b/server_test.go
@@ -8,21 +8,6 @@ import (
)
-// SetFsysAndParent sets file.fsys and file.parent for every file in the fsys.
-// Pass nil as file to setup entire file system.
-func setFsysAndParent(fsys *testFS, file *testFile) {
- if file == nil {
- file = fsys.root
- file.parent = fsys.root
- file.fsys = fsys
- }
- for _, child := range file.children {
- child.parent = file
- child.fsys = fsys
- setFsysAndParent(fsys, child)
- }
-}
-
func newReq(s *Server, msg Msg) (*Req, error) {
r, err := s.rPool.add(msg.Tag())
if err != nil {
diff --git a/test_fs.go b/test_fs.go
@@ -169,3 +169,19 @@ func init() {
}
setFsysAndParent(fsys, nil)
}
+
+// SetFsysAndParent sets file.fsys and file.parent for every file in the fsys.
+// Pass nil as file to setup entire file system.
+func setFsysAndParent(fsys *testFS, file *testFile) {
+ if file == nil {
+ file = fsys.root
+ file.parent = fsys.root
+ file.fsys = fsys
+ }
+ for _, child := range file.children {
+ child.parent = file
+ child.fsys = fsys
+ setFsysAndParent(fsys, child)
+ }
+}
+