(t *testing.T)
| 26 | ) |
| 27 | |
| 28 | func Test_EntryCreation(t *testing.T) { |
| 29 | k := []byte("k") |
| 30 | v := []byte("v") |
| 31 | ttl := 12 |
| 32 | txId := 121212 |
| 33 | entry := core.NewEntry(). |
| 34 | WithKey(k). |
| 35 | WithValue(v). |
| 36 | WithMeta( |
| 37 | core.NewMetaData(). |
| 38 | WithTTL(uint32(ttl)). |
| 39 | WithTxID(uint64(txId)). |
| 40 | WithDs(core.DataStructureBTree). |
| 41 | WithKeySize(1).WithValueSize(1), |
| 42 | ) |
| 43 | |
| 44 | assert.Equal( |
| 45 | t, |
| 46 | []byte(strconv2.Int64ToStr(int64(txId))), |
| 47 | entry.GetTxIDBytes()) |
| 48 | assert.Equal( |
| 49 | t, |
| 50 | uint32(ttl), |
| 51 | entry.Meta.TTL, |
| 52 | ) |
| 53 | assert.Equal(t, entry.Key, k) |
| 54 | assert.Equal(t, entry.Value, v) |
| 55 | assert.True(t, entry.IsBelongsToBTree()) |
| 56 | assert.False(t, entry.IsZero()) |
| 57 | } |
| 58 | |
| 59 | func Test_EntryMostFunctions(t *testing.T) { |
| 60 | r := require.New(t) |
nothing calls this directly
no test coverage detected