github.com/kngu9/glide@v0.0.0-20160505135211-e73500c73591/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/Masterminds/glide")
    22  	l.PushBack("github.com/Masterminds/vcs")
    23  	l.PushBack("github.com/Masterminds/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/Masterminds/vcs", l)
    31  	if f != true {
    32  		t.Error("findInList found false instead of true")
    33  	}
    34  }