mirror of
https://github.com/anchore/syft.git
synced 2026-02-12 10:36:45 +01:00
tests: replace Entry with DpkgMetadata name
Signed-off-by: Alfredo Deza <adeza@anchore.com>
This commit is contained in:
parent
ada11973b2
commit
6fb3a876a8
@ -5,10 +5,11 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
|
"github.com/anchore/imgbom/imgbom/pkg"
|
||||||
"github.com/go-test/deep"
|
"github.com/go-test/deep"
|
||||||
)
|
)
|
||||||
|
|
||||||
func compareEntries(t *testing.T, left, right Entry) {
|
func compareEntries(t *testing.T, left, right pkg.DpkgMetadata) {
|
||||||
t.Helper()
|
t.Helper()
|
||||||
if diff := deep.Equal(left, right); diff != nil {
|
if diff := deep.Equal(left, right); diff != nil {
|
||||||
t.Error(diff)
|
t.Error(diff)
|
||||||
@ -18,11 +19,11 @@ func compareEntries(t *testing.T, left, right Entry) {
|
|||||||
func TestSinglePackage(t *testing.T) {
|
func TestSinglePackage(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
expected Entry
|
expected pkg.DpkgMetadata
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "Test Single Package",
|
name: "Test Single Package",
|
||||||
expected: Entry{
|
expected: pkg.DpkgMetadata{
|
||||||
Package: "apt",
|
Package: "apt",
|
||||||
Status: "install ok installed",
|
Status: "install ok installed",
|
||||||
Priority: "required",
|
Priority: "required",
|
||||||
@ -73,11 +74,11 @@ func TestSinglePackage(t *testing.T) {
|
|||||||
func TestMultiplePackages(t *testing.T) {
|
func TestMultiplePackages(t *testing.T) {
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
expected []Entry
|
expected []pkg.DpkgMetadata
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "Test Multiple Package",
|
name: "Test Multiple Package",
|
||||||
expected: []Entry{
|
expected: []pkg.DpkgMetadata{
|
||||||
{
|
{
|
||||||
Package: "tzdata",
|
Package: "tzdata",
|
||||||
Status: "install ok installed",
|
Status: "install ok installed",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user