Minor fixes.
Signed-off-by: Bartlomiej Plotka <bwplotka@gmail.com>
This commit is contained in:
parent
2cf637fbf5
commit
849faa407b
|
@ -411,10 +411,9 @@ func (cmd clearCmd) String() string {
|
||||||
// is reached, evaluation errors do not terminate execution.
|
// is reached, evaluation errors do not terminate execution.
|
||||||
func (t *Test) Run() error {
|
func (t *Test) Run() error {
|
||||||
for _, cmd := range t.cmds {
|
for _, cmd := range t.cmds {
|
||||||
err := t.exec(cmd)
|
|
||||||
// TODO(fabxc): aggregate command errors, yield diffs for result
|
// TODO(fabxc): aggregate command errors, yield diffs for result
|
||||||
// comparison errors.
|
// comparison errors.
|
||||||
if err != nil {
|
if err := t.exec(cmd); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -443,6 +442,7 @@ func (t *Test) exec(tc testCommand) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer q.Close()
|
||||||
res := q.Exec(t.context)
|
res := q.Exec(t.context)
|
||||||
if res.Err != nil {
|
if res.Err != nil {
|
||||||
if cmd.fail {
|
if cmd.fail {
|
||||||
|
@ -450,7 +450,6 @@ func (t *Test) exec(tc testCommand) error {
|
||||||
}
|
}
|
||||||
return errors.Wrapf(res.Err, "error evaluating query %q (line %d)", cmd.expr, cmd.line)
|
return errors.Wrapf(res.Err, "error evaluating query %q (line %d)", cmd.expr, cmd.line)
|
||||||
}
|
}
|
||||||
defer q.Close()
|
|
||||||
if res.Err == nil && cmd.fail {
|
if res.Err == nil && cmd.fail {
|
||||||
return errors.Errorf("expected error evaluating query %q (line %d) but got none", cmd.expr, cmd.line)
|
return errors.Errorf("expected error evaluating query %q (line %d) but got none", cmd.expr, cmd.line)
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ type Iterator interface {
|
||||||
// TODO(bwplotka): Verify above statement on all implementations with unit test.
|
// TODO(bwplotka): Verify above statement on all implementations with unit test.
|
||||||
At() (int64, float64)
|
At() (int64, float64)
|
||||||
// Err returns the current error.
|
// Err returns the current error.
|
||||||
// Err can return undefined value before the iterator has advanced.
|
// Err can return undefined value before calling `Next` or `Seek`.
|
||||||
Err() error
|
Err() error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue