(t *testing.T)
| 881 | } |
| 882 | |
| 883 | func TestAfterUIDCount2(t *testing.T) { |
| 884 | key := x.DataKey(x.AttrInRootNamespace("value"), 23) |
| 885 | ol, err := readPostingListFromDisk(key, ps, math.MaxUint64) |
| 886 | require.NoError(t, err) |
| 887 | |
| 888 | // Set value to cars and merge to BadgerDB. |
| 889 | edge := &pb.DirectedEdge{} |
| 890 | |
| 891 | txn := &Txn{StartTs: 1} |
| 892 | for i := 100; i < 300; i++ { |
| 893 | edge.ValueId = uint64(i) |
| 894 | addMutationHelper(t, ol, edge, Set, txn) |
| 895 | } |
| 896 | require.EqualValues(t, 200, ol.Length(txn.StartTs, 0)) |
| 897 | require.EqualValues(t, 100, ol.Length(txn.StartTs, 199)) |
| 898 | require.EqualValues(t, 0, ol.Length(txn.StartTs, 300)) |
| 899 | |
| 900 | // Re-insert 1/4 of the edges. Counts should not change. |
| 901 | for i := 100; i < 300; i += 4 { |
| 902 | edge.ValueId = uint64(i) |
| 903 | addMutationHelper(t, ol, edge, Set, txn) |
| 904 | } |
| 905 | require.EqualValues(t, 200, ol.Length(txn.StartTs, 0)) |
| 906 | require.EqualValues(t, 100, ol.Length(txn.StartTs, 199)) |
| 907 | require.EqualValues(t, 0, ol.Length(txn.StartTs, 300)) |
| 908 | } |
| 909 | |
| 910 | func TestDelete(t *testing.T) { |
| 911 | key := x.DataKey(x.AttrInRootNamespace("value"), 25) |
nothing calls this directly
no test coverage detected