(t *testing.T)
| 138 | } |
| 139 | |
| 140 | func TestExpireStructure_PERSIST(t *testing.T) { |
| 141 | expire, _ := initExpire() |
| 142 | defer expire.db.Close() |
| 143 | |
| 144 | key := "test_key" |
| 145 | seconds := int64(2) |
| 146 | |
| 147 | // Set an expiration time for the key |
| 148 | expire.EXPIRE(key, seconds) |
| 149 | |
| 150 | // Test PERSIST function |
| 151 | expireErr = expire.PERSIST(key, seconds) |
| 152 | assert.Nil(t, expireErr) |
| 153 | |
| 154 | // Check if the key is still in the database and has no expiration time |
| 155 | ttl, err := expire.TTL(key) |
| 156 | assert.Nil(t, err) |
| 157 | assert.Equal(t, int64(-1), ttl) // -1 indicates that the key has no expiration |
| 158 | } |
| 159 | |
| 160 | func TestExpireStructure_EXPIREBY(t *testing.T) { |
| 161 | expire, _ := initExpire() |
nothing calls this directly
no test coverage detected