(t *testing.T)
| 155 | } |
| 156 | |
| 157 | func TestTx_PutWithTimestamp(t *testing.T) { |
| 158 | withDefaultDB(t, func(t *testing.T, db *DB) { |
| 159 | bucket := "bucket_put_with_timestamp" |
| 160 | |
| 161 | timestamps := []uint64{1547707905, 1547707910, uint64(time.Now().Unix())} |
| 162 | |
| 163 | { // put with timestamp |
| 164 | txCreateBucket(t, db, DataStructureBTree, bucket, nil) |
| 165 | |
| 166 | tx, err := db.Begin(true) |
| 167 | assert.NoError(t, err) |
| 168 | for i, timestamp := range timestamps { |
| 169 | key := []byte("key_" + fmt.Sprintf("%03d", i)) |
| 170 | val := []byte("val_" + fmt.Sprintf("%03d", i)) |
| 171 | |
| 172 | err = tx.PutWithTimestamp(bucket, key, val, 0, timestamp) |
| 173 | assert.NoError(t, err) |
| 174 | |
| 175 | } |
| 176 | err = tx.Commit() |
| 177 | assert.NoError(t, err) |
| 178 | } |
| 179 | }) |
| 180 | } |
| 181 | |
| 182 | func TestTx_Commit(t *testing.T) { |
| 183 | t.Run("build_bucket_indexes_after_commit", func(t *testing.T) { |
nothing calls this directly
no test coverage detected