mirror of
https://github.com/anchore/syft.git
synced 2025-11-18 08:53:15 +01:00
remove variadic functionality from intRef() test helper
Signed-off-by: Alex Goodman <alex.goodman@anchore.com>
This commit is contained in:
parent
2f81a2548c
commit
afbd8f8ea0
@ -91,7 +91,7 @@ func TestPackageURL(t *testing.T) {
|
|||||||
Metadata: pkg.RpmdbMetadata{
|
Metadata: pkg.RpmdbMetadata{
|
||||||
Name: "name",
|
Name: "name",
|
||||||
Version: "0.1.0",
|
Version: "0.1.0",
|
||||||
Epoch: intRef(),
|
Epoch: nil,
|
||||||
Arch: "amd64",
|
Arch: "amd64",
|
||||||
Release: "3",
|
Release: "3",
|
||||||
},
|
},
|
||||||
@ -131,9 +131,6 @@ func TestPackageURL(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func intRef(i ...int) *int {
|
func intRef(i int) *int {
|
||||||
if len(i) == 0 {
|
return &i
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return &i[0]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,7 +72,7 @@ func TestParseRpmDB(t *testing.T) {
|
|||||||
MetadataType: pkg.RpmdbMetadataType,
|
MetadataType: pkg.RpmdbMetadataType,
|
||||||
Metadata: pkg.RpmdbMetadata{
|
Metadata: pkg.RpmdbMetadata{
|
||||||
Name: "dive",
|
Name: "dive",
|
||||||
Epoch: intRef(),
|
Epoch: nil,
|
||||||
Arch: "x86_64",
|
Arch: "x86_64",
|
||||||
Release: "1",
|
Release: "1",
|
||||||
Version: "0.9.2",
|
Version: "0.9.2",
|
||||||
@ -99,7 +99,7 @@ func TestParseRpmDB(t *testing.T) {
|
|||||||
MetadataType: pkg.RpmdbMetadataType,
|
MetadataType: pkg.RpmdbMetadataType,
|
||||||
Metadata: pkg.RpmdbMetadata{
|
Metadata: pkg.RpmdbMetadata{
|
||||||
Name: "dive",
|
Name: "dive",
|
||||||
Epoch: intRef(),
|
Epoch: nil,
|
||||||
Arch: "x86_64",
|
Arch: "x86_64",
|
||||||
Release: "1",
|
Release: "1",
|
||||||
Version: "0.9.2",
|
Version: "0.9.2",
|
||||||
@ -204,9 +204,6 @@ func TestToElVersion(t *testing.T) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func intRef(i ...int) *int {
|
func intRef(i int) *int {
|
||||||
if len(i) == 0 {
|
return &i
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return &i[0]
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,13 +10,6 @@ import (
|
|||||||
"github.com/sergi/go-diff/diffmatchpatch"
|
"github.com/sergi/go-diff/diffmatchpatch"
|
||||||
)
|
)
|
||||||
|
|
||||||
func intRef(i ...int) *int {
|
|
||||||
if len(i) == 0 {
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return &i[0]
|
|
||||||
}
|
|
||||||
|
|
||||||
func TestRpmMetadata_pURL(t *testing.T) {
|
func TestRpmMetadata_pURL(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
distro distro.Distro
|
distro distro.Distro
|
||||||
@ -45,7 +38,7 @@ func TestRpmMetadata_pURL(t *testing.T) {
|
|||||||
Version: "v",
|
Version: "v",
|
||||||
Arch: "a",
|
Arch: "a",
|
||||||
Release: "r",
|
Release: "r",
|
||||||
Epoch: intRef(),
|
Epoch: nil,
|
||||||
},
|
},
|
||||||
expected: "pkg:rpm/redhat/p@v-r?arch=a",
|
expected: "pkg:rpm/redhat/p@v-r?arch=a",
|
||||||
},
|
},
|
||||||
@ -104,3 +97,7 @@ func TestRpmMetadata_fileOwner(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func intRef(i int) *int {
|
||||||
|
return &i
|
||||||
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user