Add support for multiple output files in different formats (#732)

This commit is contained in:
Keith Zantow
2022-01-06 17:52:20 -05:00
committed by GitHub
parent 38c4b17847
commit 5e5312c72d
51 changed files with 642 additions and 243 deletions
+11 -9
View File
@@ -7,20 +7,22 @@ import (
"github.com/anchore/syft/internal/formats/common/testutils"
)
var updateTextPresenterGoldenFiles = flag.Bool("update-text", false, "update the *.golden files for text presenters")
var updateTextEncoderGoldenFiles = flag.Bool("update-text", false, "update the *.golden files for text encoder")
func TestTextDirectoryPresenter(t *testing.T) {
testutils.AssertPresenterAgainstGoldenSnapshot(t,
Format().Presenter(testutils.DirectoryInput(t)),
*updateTextPresenterGoldenFiles,
func TestTextDirectoryEncoder(t *testing.T) {
testutils.AssertEncoderAgainstGoldenSnapshot(t,
Format(),
testutils.DirectoryInput(t),
*updateTextEncoderGoldenFiles,
)
}
func TestTextImagePresenter(t *testing.T) {
func TestTextImageEncoder(t *testing.T) {
testImage := "image-simple"
testutils.AssertPresenterAgainstGoldenImageSnapshot(t,
Format().Presenter(testutils.ImageInput(t, testImage, testutils.FromSnapshot())),
testutils.AssertEncoderAgainstGoldenImageSnapshot(t,
Format(),
testutils.ImageInput(t, testImage, testutils.FromSnapshot()),
testImage,
*updateTextPresenterGoldenFiles,
*updateTextEncoderGoldenFiles,
)
}