testing filetree
This commit is contained in:
@@ -1 +1,28 @@
|
||||
package filetree
|
||||
|
||||
import (
|
||||
"local/notes-server/config"
|
||||
"os"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestDirs(t *testing.T) {
|
||||
config.Root = "/"
|
||||
dirs := NewDirs()
|
||||
info, err := os.Stat("/usr/local")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
p := NewPathFromLocal("/usr")
|
||||
dirs.Push(p, info)
|
||||
if len([]Path(*dirs)) != 1 {
|
||||
t.Error(dirs)
|
||||
}
|
||||
first := []Path(*dirs)[0]
|
||||
if first.Base != "local" {
|
||||
t.Error(first)
|
||||
}
|
||||
if first.Local != "/usr/local" {
|
||||
t.Error(first)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user