mirror of
https://github.com/anchore/syft.git
synced 2026-11-01 06:56:40 +01:00
Add support for multiple output files in different formats (#732)
This commit is contained in:
@@ -2,6 +2,7 @@ package cli
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"os"
|
||||
"regexp"
|
||||
"strings"
|
||||
"testing"
|
||||
@@ -114,3 +115,12 @@ func assertSuccessfulReturnCode(tb testing.TB, _, _ string, rc int) {
|
||||
tb.Errorf("expected no failure but got rc=%d", rc)
|
||||
}
|
||||
}
|
||||
|
||||
func assertFileExists(file string) traitAssertion {
|
||||
return func(tb testing.TB, _, _ string, _ int) {
|
||||
tb.Helper()
|
||||
if _, err := os.Stat(file); err != nil {
|
||||
tb.Errorf("expected file to exist %s", file)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user