(t *testing.T)
| 460 | } |
| 461 | |
| 462 | func TestTx_ExpireList(t *testing.T) { |
| 463 | bucket := "bucket" |
| 464 | |
| 465 | // Verify that the list with expiration time expires normally |
| 466 | runNutsDBTest(t, nil, func(t *testing.T, db *DB) { |
| 467 | txCreateBucket(t, db, DataStructureList, bucket, nil) |
| 468 | pushDataByStartEnd(t, db, bucket, 0, 0, 3, false) |
| 469 | txLRange(t, db, bucket, testutils.GetTestBytes(0), 0, -1, 4, [][]byte{ |
| 470 | testutils.GetTestBytes(0), testutils.GetTestBytes(1), testutils.GetTestBytes(2), testutils.GetTestBytes(3), |
| 471 | }, nil) |
| 472 | |
| 473 | txExpireList(t, db, bucket, testutils.GetTestBytes(0), 1, nil) |
| 474 | time.Sleep(time.Second) |
| 475 | txLRange(t, db, bucket, testutils.GetTestBytes(0), 0, -1, 0, nil, ErrListNotFound) |
| 476 | }) |
| 477 | |
| 478 | // Verify that the list with persistent time |
| 479 | runNutsDBTest(t, nil, func(t *testing.T, db *DB) { |
| 480 | txCreateBucket(t, db, DataStructureList, bucket, nil) |
| 481 | pushDataByStartEnd(t, db, bucket, 0, 0, 3, false) |
| 482 | txExpireList(t, db, bucket, testutils.GetTestBytes(0), Persistent, nil) |
| 483 | time.Sleep(time.Second) |
| 484 | txLRange(t, db, bucket, testutils.GetTestBytes(0), 0, -1, 4, [][]byte{ |
| 485 | testutils.GetTestBytes(0), testutils.GetTestBytes(1), testutils.GetTestBytes(2), testutils.GetTestBytes(3), |
| 486 | }, nil) |
| 487 | }) |
| 488 | } |
| 489 | |
| 490 | func TestTx_LKeys(t *testing.T) { |
| 491 | bucket := "bucket" |
nothing calls this directly
no test coverage detected