increased test coverage (83.9%)
This commit is contained in:
@@ -121,3 +121,27 @@ func logTest(t *testing.T, n int, section, source string, wantResult any, wantEr
|
||||
t.Logf("[-]%s nr %3d -- `%s` --> %v", section, n, source, wantErr)
|
||||
}
|
||||
}
|
||||
|
||||
func testIteratorCallOp(t *testing.T, section string, it kern.Iterator) {
|
||||
if _, err := it.CallOperation("next", map[string]any{}); err != nil {
|
||||
t.Errorf(`%s -- CallOperation("next") failed: %v`, section, err)
|
||||
}
|
||||
if _, err := it.CallOperation("current", map[string]any{}); err != nil {
|
||||
t.Errorf(`%s -- CallOperation("current") failed: %v`, section, err)
|
||||
}
|
||||
if _, err := it.CallOperation("clean", map[string]any{}); err != nil {
|
||||
t.Errorf(`%s -- CallOperation("clean") failed: %v`, section, err)
|
||||
}
|
||||
if _, err := it.CallOperation("index", map[string]any{}); err != nil {
|
||||
t.Errorf(`%s -- CallOperation("index") failed: %v`, section, err)
|
||||
}
|
||||
if _, err := it.CallOperation("count", map[string]any{}); err != nil {
|
||||
t.Errorf(`%s -- CallOperation("count") failed: %v`, section, err)
|
||||
}
|
||||
if _, err := it.CallOperation("reset", map[string]any{}); err != nil {
|
||||
t.Errorf(`%s -- CallOperation("reset") failed: %v`, section, err)
|
||||
}
|
||||
if _, err := it.CallOperation("fake", map[string]any{}); err == nil {
|
||||
t.Errorf(`%s -- CallOperation("fake") should return error`, section)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user