Skip to content

Commit

Permalink
change to go style vars and error msgs in lru tests
Browse files Browse the repository at this point in the history
Error messages changed to use "got X; expected Y" style.
and no underscore for var names.
  • Loading branch information
cnu committed May 8, 2017
1 parent 6afebe8 commit 68d4102
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lru/lru_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ func TestRemove(t *testing.T) {
}

func TestAdd(t *testing.T) {
lru_cache := New(3)
lru := New(3)
items := []struct {
key string
value string
Expand All @@ -86,10 +86,10 @@ func TestAdd(t *testing.T) {
{"four", "4"},
}
for _, tt := range items {
lru_cache.Add(tt.key, tt.value)
lru.Add(tt.key, tt.value)
}
if lru_cache.ll.Len() != 3 {
t.Fatalf("Expected 3 items; got %d items", lru_cache.ll.Len())
if lru.ll.Len() != 3 {
t.Fatalf("lru size: %d items; expected 3 items", lru.ll.Len())
}
}

Expand All @@ -101,6 +101,6 @@ func TestAddToNilCache(t *testing.T) {
}
c.Add("foo", "bar")
if c.ll.Len() != 1 {
t.Fatalf("Expected 1 item; got %d items", c.ll.Len())
t.Fatalf("lru size: %d items; expected 1 item", c.ll.Len())
}
}

0 comments on commit 68d4102

Please sign in to comment.