(t *testing.T)
| 295 | } |
| 296 | |
| 297 | func TestAddMutation_DelSet(t *testing.T) { |
| 298 | key := x.DataKey(x.AttrInRootNamespace(x.AttrInRootNamespace("value")), 1534) |
| 299 | ol, err := GetNoStore(key, math.MaxUint64) |
| 300 | require.NoError(t, err) |
| 301 | ol.mutationMap.setTs(1) |
| 302 | |
| 303 | // DO sp*, don't commit |
| 304 | // Del a value cars and but don't merge. |
| 305 | edge := &pb.DirectedEdge{ |
| 306 | Value: []byte(x.Star), |
| 307 | Op: pb.DirectedEdge_DEL, |
| 308 | } |
| 309 | txn := &Txn{StartTs: 1} |
| 310 | require.NoError(t, ol.addMutation(context.Background(), txn, edge)) |
| 311 | |
| 312 | // Set value to newcars, commit it |
| 313 | edge = &pb.DirectedEdge{ |
| 314 | Value: []byte("newcars"), |
| 315 | } |
| 316 | ol1, err := GetNoStore(key, math.MaxUint64) |
| 317 | ol1.mutationMap.setTs(2) |
| 318 | require.NoError(t, err) |
| 319 | txn = &Txn{StartTs: 2} |
| 320 | addMutationHelper(t, ol1, edge, Set, txn) |
| 321 | require.NoError(t, ol1.commitMutation(2, uint64(3))) |
| 322 | require.EqualValues(t, 1, ol1.Length(3, 0)) |
| 323 | checkValue(t, ol1, "newcars", 3) |
| 324 | } |
| 325 | |
| 326 | func TestAddMutation_DelRead(t *testing.T) { |
| 327 | key := x.DataKey(x.AttrInRootNamespace(x.AttrInRootNamespace("value")), 1543) |
nothing calls this directly
no test coverage detected