Skip to content

Commit

Permalink
Some more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iddan authored and dennwc committed Nov 14, 2019
1 parent 545fd2d commit 3d0c9f9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion graph/graphtest/graphtest.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ func BenchmarkAll(b *testing.B, gen testutil.DatabaseFunc, conf *Config) {
})
}

// This is a simple test graph.
// MakeQuadSet makes a simple test graph.
//
// +---+ +---+
// | A |------- ->| F |<--
Expand Down Expand Up @@ -842,6 +842,7 @@ func TestLoadTypedQuads(t testing.TB, gen testutil.DatabaseFunc, conf *Config) {
require.Equal(t, exp, st, "Unexpected quadstore size")
}

// TestAddRemove tests add and remove
// TODO(dennwc): add tests to verify that QS behaves in a right way with IgnoreOptions,
// returns ErrQuadExists, ErrQuadNotExists is doing rollback.
func TestAddRemove(t testing.TB, gen testutil.DatabaseFunc, conf *Config) {
Expand Down
2 changes: 1 addition & 1 deletion graph/iterator/fixed.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Fixed struct {
values []refs.Ref
}

// Creates a new Fixed iterator with a custom comparator.
// NewFixed creates a new Fixed iterator with a custom comparator.
func NewFixed(vals ...refs.Ref) *Fixed {
return &Fixed{
values: append([]refs.Ref{}, vals...),
Expand Down
7 changes: 5 additions & 2 deletions graph/iterator/iterator.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ type Index interface {
Contains(ctx context.Context, v refs.Ref) bool
}

// Tagger is an interface for iterators that can tag values. Tags are returned as a part of TagResults call.
// TaggerShape is an interface for iterators that can tag values. Tags are returned as a part of TagResults call.
type TaggerShape interface {
Shape
TaggerBase
Expand Down Expand Up @@ -172,20 +172,23 @@ func Height(it Shape, filter func(Shape) bool) int {
return maxDepth + 1
}

// Here we define the simplest iterator -- the Null iterator. It contains nothing.
// Null is the simplest iterator -- the Null iterator. It contains nothing.
// It is the empty set. Often times, queries that contain one of these match nothing,
// so it's important to give it a special iterator.
type Null struct{}

// NewNull creates a new Null iterator
// Fairly useless New function.
func NewNull() *Null {
return &Null{}
}

// Iterate implements Iterator
func (it *Null) Iterate() Scanner {
return it
}

// Lookup implements Iterator
func (it *Null) Lookup() Index {
return it
}
Expand Down
2 changes: 1 addition & 1 deletion graph/iterator/resolver.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type Resolver struct {
order []quad.Value
}

// Creates a new Resolver iterator.
// NewResolver creates a new Resolver iterator.
func NewResolver(qs refs.Namer, nodes ...quad.Value) *Resolver {
it := &Resolver{
qs: qs,
Expand Down

0 comments on commit 3d0c9f9

Please sign in to comment.