increased test coverage (83.9%)

This commit is contained in:
2026-05-21 03:06:52 +02:00
parent 1055569dd6
commit a62f27b104
10 changed files with 190 additions and 45 deletions
+24
View File
@@ -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)
}
}