File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,6 @@ require (
2424 github.com/open-policy-agent/opa v1.11.0
2525 github.com/opencontainers/image-spec v1.1.1
2626 github.com/owenrumney/go-sarif/v2 v2.3.3
27- github.com/pkg/errors v0.9.1
2827 github.com/shteou/go-ignore v0.3.1
2928 github.com/spdx/tools-golang v0.5.5
3029 github.com/spf13/cobra v1.10.1
@@ -125,6 +124,7 @@ require (
125124 github.com/olekukonko/ll v0.0.9 // indirect
126125 github.com/opencontainers/go-digest v1.0.0 // indirect
127126 github.com/pelletier/go-toml/v2 v2.2.4 // indirect
127+ github.com/pkg/errors v0.9.1 // indirect
128128 github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
129129 github.com/prometheus/client_golang v1.23.2 // indirect
130130 github.com/prometheus/client_model v0.6.2 // indirect
Original file line number Diff line number Diff line change @@ -2,11 +2,11 @@ package cyclonedx
22
33import (
44 "testing"
5-
6- "github.com/pkg/errors"
75)
86
97func TestCycloneDXParserValid (t * testing.T ) {
8+ t .Parallel ()
9+
1010 // generated by syft packages docker:devopps/busybox:latest -o cyclonedx --file report.xml
1111 // cat report.xml | cyclonedx-cli convert --input-format xml --output-format json
1212 sbom := `{
@@ -62,6 +62,8 @@ func TestCycloneDXParserValid(t *testing.T) {
6262}
6363
6464func TestCycloneDXParserInValid (t * testing.T ) {
65+ t .Parallel ()
66+
6567 // generated by syft packages docker:devopps/busybox:latest -o cyclonedx --file report.xml
6668 // cat report.xml | cyclonedx-cli convert --input-format xml --output-format json
6769 sbom := `{
@@ -111,12 +113,7 @@ func TestCycloneDXParserInValid(t *testing.T) {
111113 component := metadata .(map [string ]any )["component" ]
112114 currentSHA256 := component .(map [string ]any )["version" ]
113115
114- var err error
115- if expectedSHA256 != currentSHA256 {
116- err = errors .Errorf ("current SHA256 %s is different from the expected SHA256 %s" , currentSHA256 , expectedSHA256 )
117- }
118-
119- if err == nil {
116+ if expectedSHA256 == currentSHA256 {
120117 t .Error ("current SHA256 and expected SHA256 should not be equal" )
121118 }
122119}
You can’t perform that action at this time.
0 commit comments