mirror of
https://github.com/anchore/syft.git
synced 2026-11-02 15:36:41 +01:00
Pr 1825 (#1865)
chore: code cleanup Signed-off-by: guoguangwu <guoguangwu@magic-shield.com> --------- Signed-off-by: guoguangwu <guoguangwu@magic-shield.com> Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com> Co-authored-by: guoguangwu <guoguangwu@magic-shield.com>
This commit is contained in:
co-authored by
guoguangwu
parent
d676e5e781
commit
f07581f504
@@ -3,7 +3,7 @@ package cpe
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -80,12 +80,12 @@ func Test_normalizeCpeField(t *testing.T) {
|
||||
}
|
||||
|
||||
func Test_CPEParser(t *testing.T) {
|
||||
testCases := []struct {
|
||||
var testCases []struct {
|
||||
CPEString string `json:"cpe-string"`
|
||||
CPEUrl string `json:"cpe-url"`
|
||||
WFN CPE `json:"wfn"`
|
||||
}{}
|
||||
out, err := ioutil.ReadFile("test-fixtures/cpe-data.json")
|
||||
}
|
||||
out, err := os.ReadFile("test-fixtures/cpe-data.json")
|
||||
require.NoError(t, err)
|
||||
require.NoError(t, json.Unmarshal(out, &testCases))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user