github.com/yylbfyl/glide@v0.0.0-20230427033633-b23b3139ece7/tree/tree_test.go (about) 1 /* Package tree contains functions for printing a dependency tree. 2 3 The future of the tree functionality is uncertain, as it is neither core to 4 the functionality of Glide, nor particularly complementary. Its principal use 5 case is for debugging the generated dependency tree. 6 7 Currently, the tree package builds its dependency tree in a slightly different 8 way than the `dependency` package does. This should not make any practical 9 difference, though code-wise it would be nice to change this over to use the 10 `dependency` resolver. 11 */ 12 package tree 13 14 import ( 15 "container/list" 16 "testing" 17 ) 18 19 func TestFindInTree(t *testing.T) { 20 l := list.New() 21 l.PushBack("github.com/yylbfyl/glide") 22 l.PushBack("github.com/yylbfyl/vcs") 23 l.PushBack("github.com/yylbfyl/semver") 24 25 f := findInList("foo", l) 26 if f != false { 27 t.Error("findInList found true instead of false") 28 } 29 30 f = findInList("github.com/yylbfyl/vcs", l) 31 if f != true { 32 t.Error("findInList found false instead of true") 33 } 34 }