@@ -18,27 +18,35 @@ func TestTreeChild(t *testing.T) {
1818 t .Fatal ("should not be nil" )
1919 } else if c .Name () != "root" {
2020 t .Fatalf ("bad: %#v" , c .Name ())
21+ } else if ! reflect .DeepEqual (c .Path (), []string (nil )) {
22+ t .Fatalf ("bad: %#v" , c .Path ())
2123 }
2224
2325 // Should be able to get the root child
2426 if c := tree .Child (nil ); c == nil {
2527 t .Fatal ("should not be nil" )
2628 } else if c .Name () != "root" {
2729 t .Fatalf ("bad: %#v" , c .Name ())
30+ } else if ! reflect .DeepEqual (c .Path (), []string (nil )) {
31+ t .Fatalf ("bad: %#v" , c .Path ())
2832 }
2933
3034 // Should be able to get the foo child
3135 if c := tree .Child ([]string {"foo" }); c == nil {
3236 t .Fatal ("should not be nil" )
3337 } else if c .Name () != "foo" {
3438 t .Fatalf ("bad: %#v" , c .Name ())
39+ } else if ! reflect .DeepEqual (c .Path (), []string {"foo" }) {
40+ t .Fatalf ("bad: %#v" , c .Path ())
3541 }
3642
3743 // Should be able to get the nested child
3844 if c := tree .Child ([]string {"foo" , "bar" }); c == nil {
3945 t .Fatal ("should not be nil" )
4046 } else if c .Name () != "bar" {
4147 t .Fatalf ("bad: %#v" , c .Name ())
48+ } else if ! reflect .DeepEqual (c .Path (), []string {"foo" , "bar" }) {
49+ t .Fatalf ("bad: %#v" , c .Path ())
4250 }
4351}
4452
@@ -274,16 +282,16 @@ func TestTreeValidate_requiredChildVar(t *testing.T) {
274282
275283const treeLoadStr = `
276284root
277- foo
285+ foo (path: foo)
278286`
279287
280288const treeLoadParentStr = `
281289root
282- a
283- b
290+ a (path: a)
291+ b (path: a, b)
284292`
285293const treeLoadSubdirStr = `
286294root
287- foo
288- bar
295+ foo (path: foo)
296+ bar (path: foo, bar)
289297`
0 commit comments