Improve Transaction: deduplicate quads, allow adding/removing a quad in the same tx
This commit is contained in:
parent
45d96e14ec
commit
91fc9ee3de
2 changed files with 7 additions and 7 deletions
|
|
@ -29,8 +29,8 @@ func TestTransaction(t *testing.T) {
|
|||
|
||||
// remove, add -> nothing
|
||||
tx = NewTransaction()
|
||||
tx.AddQuad(quad.Quad{Subject: "E", Predicate: "follows", Object: "G", Label: ""})
|
||||
tx.RemoveQuad(quad.Quad{Subject: "E", Predicate: "follows", Object: "G", Label: ""})
|
||||
tx.AddQuad(quad.Quad{Subject: "E", Predicate: "follows", Object: "G", Label: ""})
|
||||
if len(tx.Deltas) != 0 {
|
||||
t.Errorf("Expected [add, remove]->[], have %d delta(s)", len(tx.Deltas))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue