(t *testing.T)
| 1125 | } |
| 1126 | |
| 1127 | func TestReplace(t *testing.T) { |
| 1128 | tc := New(DefaultExpiration, 0) |
| 1129 | err := tc.Replace("foo", "bar", DefaultExpiration) |
| 1130 | if err == nil { |
| 1131 | t.Error("Replaced foo when it shouldn't exist") |
| 1132 | } |
| 1133 | tc.Set("foo", "bar", DefaultExpiration) |
| 1134 | err = tc.Replace("foo", "bar", DefaultExpiration) |
| 1135 | if err != nil { |
| 1136 | t.Error("Couldn't replace existing key foo") |
| 1137 | } |
| 1138 | } |
| 1139 | |
| 1140 | func TestDelete(t *testing.T) { |
| 1141 | tc := New(DefaultExpiration, 0) |