repo.TestUpdateTracker   A
last analyzed

Complexity

Conditions 4

Size

Total Lines 17
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 4
eloc 10
nop 1
dl 0
loc 17
rs 9.9
c 0
b 0
f 0
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
}
24