@@ -93,12 +93,12 @@ func verifyImageHasExpectedFeatures(t *testing.T, client *client.Clairify, test
93
93
feature .Executables = nil
94
94
matching .Executables = nil
95
95
96
+ matchingBytes , _ := json .MarshalIndent (matching .Vulnerabilities , "" , " " )
96
97
if ! test .onlyCheckSpecifiedVulns {
97
98
if len (matching .Vulnerabilities ) != len (feature .Vulnerabilities ) {
98
- matchingBytes , _ := json .MarshalIndent (matching .Vulnerabilities , "" , " " )
99
99
featureVulnsBytes , _ := json .MarshalIndent (feature .Vulnerabilities , "" , " " )
100
- fmt .Printf ("Matching: %s\n " , matchingBytes )
101
- fmt .Printf ("Expected Feature: %s\n " , featureVulnsBytes )
100
+ fmt .Printf ("Matching: %s\n " , string ( matchingBytes ) )
101
+ fmt .Printf ("Expected Feature: %s\n " , string ( featureVulnsBytes ) )
102
102
}
103
103
104
104
require .Equal (t , len (feature .Vulnerabilities ), len (matching .Vulnerabilities ))
@@ -116,7 +116,7 @@ func verifyImageHasExpectedFeatures(t *testing.T, client *client.Clairify, test
116
116
foundMatch = true
117
117
checkMatch (t , test .source , expectedVuln , matchingVuln )
118
118
}
119
- assert .Truef (t , foundMatch , "Expected to find %s in scan results" , expectedVuln .Name )
119
+ assert .Truef (t , foundMatch , "Expected to find %s in scan results\n Found the following: %s " , expectedVuln .Name , string ( matchingBytes ) )
120
120
}
121
121
}
122
122
feature .Vulnerabilities = nil
0 commit comments