Skip to content

Commit f743bb0

Browse files
daynewleehdonnay
authored andcommitted
Oval: updated variable name and Update oval/resolution_test.go
1 parent f1b0bab commit f743bb0

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

oval/resolution_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@ package oval
22

33
import (
44
"encoding/xml"
5-
"github.com/google/go-cmp/cmp"
65
"os"
76
"testing"
7+
8+
"github.com/google/go-cmp/cmp"
89
)
910

1011
func TestAdvisory(t *testing.T) {
@@ -27,13 +28,13 @@ func TestAdvisory(t *testing.T) {
2728
stateExample := [4]string{"Will not fix", "Will not fix", "Will not fix", "Affected"}
2829
componentLength := [4]int{1, 9, 1, 3}
2930
for i := 0; i < m; i++ {
30-
if !cmp.Equal(len(arr[i].Advisory.Affected.Resolution), 1) {
31+
if !cmp.Equal(len(arr[i].Advisory.Affected.Resolutions), 1) {
3132
t.Fatal("Affected resolution list length is incorrect")
3233
}
33-
resolution := arr[i].Advisory.Affected.Resolution[0]
34+
resolution := arr[i].Advisory.Affected.Resolutions[0]
3435
name := resolution.State
3536
if !cmp.Equal(name, stateExample[i]) {
36-
t.Fatal("Resolution state is incorrect")
37+
t.Fatal("Resolutions state is incorrect")
3738
}
3839
if !cmp.Equal(len(resolution.Components), componentLength[i]) {
3940
t.Fatal("Component list length is incorrect")

oval/types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ type Advisory struct {
105105
// AffectedStatus documentation:
106106
// https://access.redhat.com/articles/5554431 section Oct 13, 2021 Oval
107107
type AffectedStatus struct {
108-
Resolution []Resolution `xml:"resolution"`
108+
Resolutions []Resolution `xml:"resolution"`
109109
}
110110

111111
// Resolution state values are one of:

0 commit comments

Comments
 (0)