29 lines
472 B
Go
Executable File
29 lines
472 B
Go
Executable File
package filetree
|
|
|
|
import (
|
|
"gogs.inhome.blapointe.com/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)
|
|
}
|
|
}
|