2014-09-14 23:46:45 +02:00
|
|
|
package module
|
|
|
|
|
|
|
|
import (
|
|
|
|
"reflect"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
2014-09-15 01:17:29 +02:00
|
|
|
func TestTree_Load(t *testing.T) {
|
|
|
|
tree := NewTree(testConfig(t, "basic"))
|
|
|
|
if err := tree.Load(testStorage(t), GetModeGet); err != nil {
|
|
|
|
t.Fatalf("err: %s", err)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
func TestTree_Modules(t *testing.T) {
|
2014-09-14 23:46:45 +02:00
|
|
|
tree := NewTree(testConfig(t, "basic"))
|
|
|
|
actual := tree.Modules()
|
|
|
|
|
|
|
|
expected := []*Module{
|
|
|
|
&Module{Name: "foo", Source: "./foo"},
|
|
|
|
}
|
|
|
|
|
|
|
|
if !reflect.DeepEqual(actual, expected) {
|
|
|
|
t.Fatalf("bad: %#v", actual)
|
|
|
|
}
|
|
|
|
}
|