mirror of
https://github.com/anchore/syft.git
synced 2026-11-02 15:36:41 +01:00
Add support for multiple output files in different formats (#732)
This commit is contained in:
@@ -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,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user