mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 16:33:21 +01:00
chore: update test redactor ordering (#1765)
Signed-off-by: Keith Zantow <kzantow@gmail.com>
This commit is contained in:
parent
fd02bef0a3
commit
451cb9d5ca
@ -47,13 +47,14 @@ func AssertEncoderAgainstGoldenImageSnapshot(t *testing.T, format sbom.Format, s
|
|||||||
|
|
||||||
err := format.Encode(&buffer, sbom)
|
err := format.Encode(&buffer, sbom)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
actual := redact(buffer.Bytes(), redactors...)
|
actual := buffer.Bytes()
|
||||||
|
|
||||||
// replace the expected snapshot contents with the current encoder contents
|
// replace the expected snapshot contents with the current encoder contents
|
||||||
if updateSnapshot {
|
if updateSnapshot {
|
||||||
testutils.UpdateGoldenFileContents(t, actual)
|
testutils.UpdateGoldenFileContents(t, actual)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actual = redact(actual, redactors...)
|
||||||
expected := redact(testutils.GetGoldenFileContents(t), redactors...)
|
expected := redact(testutils.GetGoldenFileContents(t), redactors...)
|
||||||
|
|
||||||
if json {
|
if json {
|
||||||
@ -71,13 +72,14 @@ func AssertEncoderAgainstGoldenSnapshot(t *testing.T, format sbom.Format, sbom s
|
|||||||
|
|
||||||
err := format.Encode(&buffer, sbom)
|
err := format.Encode(&buffer, sbom)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
actual := redact(buffer.Bytes(), redactors...)
|
actual := buffer.Bytes()
|
||||||
|
|
||||||
// replace the expected snapshot contents with the current encoder contents
|
// replace the expected snapshot contents with the current encoder contents
|
||||||
if updateSnapshot {
|
if updateSnapshot {
|
||||||
testutils.UpdateGoldenFileContents(t, actual)
|
testutils.UpdateGoldenFileContents(t, actual)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
actual = redact(actual, redactors...)
|
||||||
expected := redact(testutils.GetGoldenFileContents(t), redactors...)
|
expected := redact(testutils.GetGoldenFileContents(t), redactors...)
|
||||||
|
|
||||||
if json {
|
if json {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user