Skip to content

Commit 68d4102

Browse files
committed
change to go style vars and error msgs in lru tests
Error messages changed to use "got X; expected Y" style. and no underscore for var names.
1 parent 6afebe8 commit 68d4102

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lru/lru_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func TestRemove(t *testing.T) {
7474
}
7575

7676
func TestAdd(t *testing.T) {
77-
lru_cache := New(3)
77+
lru := New(3)
7878
items := []struct {
7979
key string
8080
value string
@@ -86,10 +86,10 @@ func TestAdd(t *testing.T) {
8686
{"four", "4"},
8787
}
8888
for _, tt := range items {
89-
lru_cache.Add(tt.key, tt.value)
89+
lru.Add(tt.key, tt.value)
9090
}
91-
if lru_cache.ll.Len() != 3 {
92-
t.Fatalf("Expected 3 items; got %d items", lru_cache.ll.Len())
91+
if lru.ll.Len() != 3 {
92+
t.Fatalf("lru size: %d items; expected 3 items", lru.ll.Len())
9393
}
9494
}
9595

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

0 commit comments

Comments
 (0)