chore: add source completion tester (#4077)

* add source completion tester

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* add missing t.Helper calls

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman
2025-07-23 13:49:47 +00:00
committed by GitHub
parent 48bf81cf7f
commit f0a990b85f
3 changed files with 65 additions and 0 deletions
@@ -4,14 +4,27 @@ import (
"testing"
"github.com/anchore/syft/syft/internal/packagemetadata"
"github.com/anchore/syft/syft/internal/sourcemetadata"
)
type PackageMetadataCompletionTester struct {
*packagemetadata.CompletionTester
}
type SourceMetadataCompletionTester struct {
*sourcemetadata.CompletionTester
}
func NewPackageMetadataCompletionTester(t testing.TB, ignore ...any) *PackageMetadataCompletionTester {
t.Helper()
return &PackageMetadataCompletionTester{
CompletionTester: packagemetadata.NewCompletionTester(t, ignore...),
}
}
func NewSourceMetadataCompletionTester(t testing.TB, ignore ...any) *SourceMetadataCompletionTester {
t.Helper()
return &SourceMetadataCompletionTester{
CompletionTester: sourcemetadata.NewCompletionTester(t, ignore...),
}
}