github.com/avvmoto/glide@v0.12.3/repo/tracker_test.go (about)

     1  package repo
     2  
     3  import "testing"
     4  
     5  func TestUpdateTracker(t *testing.T) {
     6  	tr := NewUpdateTracker()
     7  
     8  	if f := tr.Check("github.com/foo/bar"); f != false {
     9  		t.Error("Error, package Check passed on empty tracker")
    10  	}
    11  
    12  	tr.Add("github.com/foo/bar")
    13  
    14  	if f := tr.Check("github.com/foo/bar"); f != true {
    15  		t.Error("Error, failed to add package to tracker")
    16  	}
    17  
    18  	tr.Remove("github.com/foo/bar")
    19  
    20  	if f := tr.Check("github.com/foo/bar"); f != false {
    21  		t.Error("Error, failed to remove package from tracker")
    22  	}
    23  }