Base project to template
This commit is contained in:
26
server/.notes/dir_test.go
Executable file
26
server/.notes/dir_test.go
Executable file
@@ -0,0 +1,26 @@
|
||||
package notes
|
||||
|
||||
import (
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestLsDir(t *testing.T) {
|
||||
p := Path{Local: "/usr/local"}
|
||||
dirs, files := lsDir(p)
|
||||
if len(dirs) == 0 {
|
||||
t.Fatal(len(dirs))
|
||||
}
|
||||
if len(files) == 0 {
|
||||
t.Fatal(len(files))
|
||||
}
|
||||
t.Log(dirs)
|
||||
t.Log(files)
|
||||
}
|
||||
|
||||
func TestNotesDir(t *testing.T) {
|
||||
path := Path{Local: "/usr/local"}
|
||||
w := httptest.NewRecorder()
|
||||
notesDir(path, w, nil)
|
||||
t.Logf("%s", w.Body.Bytes())
|
||||
}
|
||||
Reference in New Issue
Block a user