@@ -22,10 +22,6 @@ func TestParse(t *testing.T) {
22
22
name : "ELF" ,
23
23
inputFile : "testdata/test.elf" ,
24
24
want : []types.Library {
25
- {
26
- Name : "stdlib" ,
27
- Version : "1.15.2" ,
28
- },
29
25
{
30
26
Name : "github.com/aquasecurity/go-pep440-version" ,
31
27
Version : "v0.0.0-20210121094942-22b2f8951d46" ,
@@ -34,20 +30,24 @@ func TestParse(t *testing.T) {
34
30
Name : "github.com/aquasecurity/go-version" ,
35
31
Version : "v0.0.0-20210121072130-637058cfe492" ,
36
32
},
33
+ {
34
+ Name : "github.com/aquasecurity/test" ,
35
+ Version : "" ,
36
+ },
37
37
{
38
38
Name : "golang.org/x/xerrors" ,
39
39
Version : "v0.0.0-20200804184101-5ec99f83aff1" ,
40
40
},
41
+ {
42
+ Name : "stdlib" ,
43
+ Version : "1.15.2" ,
44
+ },
41
45
},
42
46
},
43
47
{
44
48
name : "PE" ,
45
49
inputFile : "testdata/test.exe" ,
46
50
want : []types.Library {
47
- {
48
- Name : "stdlib" ,
49
- Version : "1.15.2" ,
50
- },
51
51
{
52
52
Name : "github.com/aquasecurity/go-pep440-version" ,
53
53
Version : "v0.0.0-20210121094942-22b2f8951d46" ,
@@ -56,20 +56,24 @@ func TestParse(t *testing.T) {
56
56
Name : "github.com/aquasecurity/go-version" ,
57
57
Version : "v0.0.0-20210121072130-637058cfe492" ,
58
58
},
59
+ {
60
+ Name : "github.com/aquasecurity/test" ,
61
+ Version : "" ,
62
+ },
59
63
{
60
64
Name : "golang.org/x/xerrors" ,
61
65
Version : "v0.0.0-20200804184101-5ec99f83aff1" ,
62
66
},
67
+ {
68
+ Name : "stdlib" ,
69
+ Version : "1.15.2" ,
70
+ },
63
71
},
64
72
},
65
73
{
66
74
name : "Mach-O" ,
67
75
inputFile : "testdata/test.macho" ,
68
76
want : []types.Library {
69
- {
70
- Name : "stdlib" ,
71
- Version : "1.15.2" ,
72
- },
73
77
{
74
78
Name : "github.com/aquasecurity/go-pep440-version" ,
75
79
Version : "v0.0.0-20210121094942-22b2f8951d46" ,
@@ -78,28 +82,54 @@ func TestParse(t *testing.T) {
78
82
Name : "github.com/aquasecurity/go-version" ,
79
83
Version : "v0.0.0-20210121072130-637058cfe492" ,
80
84
},
85
+ {
86
+ Name : "github.com/aquasecurity/test" ,
87
+ Version : "" ,
88
+ },
81
89
{
82
90
Name : "golang.org/x/xerrors" ,
83
91
Version : "v0.0.0-20200804184101-5ec99f83aff1" ,
84
92
},
93
+ {
94
+ Name : "stdlib" ,
95
+ Version : "1.15.2" ,
96
+ },
85
97
},
86
98
},
87
99
{
88
100
name : "with replace directive" ,
89
101
inputFile : "testdata/replace.elf" ,
90
102
want : []types.Library {
91
- {
92
- Name : "stdlib" ,
93
- Version : "1.16.4" ,
94
- },
95
103
{
96
104
Name : "github.com/davecgh/go-spew" ,
97
105
Version : "v1.1.1" ,
98
106
},
107
+ {
108
+ Name : "github.com/ebati/trivy-mod-parse" ,
109
+ Version : "" ,
110
+ },
99
111
{
100
112
Name : "github.com/go-sql-driver/mysql" ,
101
113
Version : "v1.5.0" ,
102
114
},
115
+ {
116
+ Name : "stdlib" ,
117
+ Version : "1.16.4" ,
118
+ },
119
+ },
120
+ },
121
+ {
122
+ name : "with semver main module version" ,
123
+ inputFile : "testdata/semver-main-module-version.macho" ,
124
+ want : []types.Library {
125
+ {
126
+ Name : "go.etcd.io/bbolt" ,
127
+ Version : "v1.3.5" ,
128
+ },
129
+ {
130
+ Name : "stdlib" ,
131
+ Version : "1.20.6" ,
132
+ },
103
133
},
104
134
},
105
135
{
0 commit comments