(t *testing.T)
| 1129 | } |
| 1130 | |
| 1131 | func TestAdd(t *testing.T) { |
| 1132 | tc := New(DefaultExpiration, 0) |
| 1133 | err := tc.Add("foo", "bar", DefaultExpiration) |
| 1134 | if err != nil { |
| 1135 | t.Error("Couldn't add foo even though it shouldn't exist") |
| 1136 | } |
| 1137 | err = tc.Add("foo", "baz", DefaultExpiration) |
| 1138 | if err == nil { |
| 1139 | t.Error("Successfully added another foo when it should have returned an error") |
| 1140 | } |
| 1141 | } |
| 1142 | |
| 1143 | func TestReplace(t *testing.T) { |
| 1144 | tc := New(DefaultExpiration, 0) |