(t *testing.T)
| 1113 | } |
| 1114 | |
| 1115 | func TestAdd(t *testing.T) { |
| 1116 | tc := New(DefaultExpiration, 0) |
| 1117 | err := tc.Add("foo", "bar", DefaultExpiration) |
| 1118 | if err != nil { |
| 1119 | t.Error("Couldn't add foo even though it shouldn't exist") |
| 1120 | } |
| 1121 | err = tc.Add("foo", "baz", DefaultExpiration) |
| 1122 | if err == nil { |
| 1123 | t.Error("Successfully added another foo when it should have returned an error") |
| 1124 | } |
| 1125 | } |
| 1126 | |
| 1127 | func TestReplace(t *testing.T) { |
| 1128 | tc := New(DefaultExpiration, 0) |