Skip to content

Commit

Permalink
update test to check all return codes, update variable name.
Browse files Browse the repository at this point in the history
  • Loading branch information
3pCode authored and dennwc committed Oct 21, 2018
1 parent b8672a5 commit e4023df
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions graph/graphtest/graphtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -1103,11 +1103,13 @@ func TestDeleteReinserted(t testing.TB, gen testutil.DatabaseFunc, _ *Config) {
quad.Make("<bob>", "<status>", "Feeling happy", nil),
quad.Make("<sally>", "<follows>", "<jim>", nil),
})
require.NoError(t, err, "Add quadset failed")

for i := 0; i < 2; i++ {
w.AddQuad(quad.Make("<bob>", "<follows>", "<sally>", nil))
err = w.AddQuad(quad.Make("<bob>", "<follows>", "<sally>", nil))
require.NoError(t, err, "Add quad failed")
err = w.RemoveQuad(quad.Make("<bob>", "<follows>", "<sally>", nil))
assert.Nil(t, err, "Remove quad failed")
require.NoError(t, err, "Remove quad failed")
}

}
4 changes: 2 additions & 2 deletions graph/kv/indexing.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,9 +675,9 @@ func (qs *QuadStore) hasPrimitive(ctx context.Context, tx BucketTx, p *proto.Pri
if !get && unique {
return p, nil
}
for ix := len(options) - 1; ix >= 0; ix-- {
for i := len(options) - 1; i >= 0; i-- {
// TODO: batch
prim, err := qs.getPrimitiveFromLog(ctx, tx, options[ix])
prim, err := qs.getPrimitiveFromLog(ctx, tx, options[i])

if err != nil {
return nil, err
Expand Down

0 comments on commit e4023df

Please sign in to comment.