[tests] use assert.ElementsMatch instead of reflect.DeepEqual in distro_test
The asserts should do the same job and also make sure that the two compared lists are the same at the same time. Refs: #442
This commit is contained in:
parent
4aeb6f2b28
commit
cdcd09dd67
3 changed files with 3 additions and 6 deletions
|
|
@ -1,7 +1,6 @@
|
|||
package fedora30_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/distro/distro_test_common"
|
||||
|
|
@ -136,7 +135,7 @@ func TestImageType_BuildPackages(t *testing.T) {
|
|||
t.Errorf("d.GetArch(%v) returned err = %v; expected nil", archLabel, err)
|
||||
continue
|
||||
}
|
||||
reflect.DeepEqual(itStruct.BuildPackages(), buildPackages[archLabel])
|
||||
assert.ElementsMatch(t, buildPackages[archLabel], itStruct.BuildPackages())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package fedora31_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/distro/distro_test_common"
|
||||
|
|
@ -136,7 +135,7 @@ func TestImageType_BuildPackages(t *testing.T) {
|
|||
t.Errorf("d.GetArch(%v) returned err = %v; expected nil", archLabel, err)
|
||||
continue
|
||||
}
|
||||
reflect.DeepEqual(itStruct.BuildPackages(), buildPackages[archLabel])
|
||||
assert.ElementsMatch(t, buildPackages[archLabel], itStruct.BuildPackages())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
package fedora32_test
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
"github.com/osbuild/osbuild-composer/internal/distro/distro_test_common"
|
||||
|
|
@ -136,7 +135,7 @@ func TestImageType_BuildPackages(t *testing.T) {
|
|||
t.Errorf("d.GetArch(%v) returned err = %v; expected nil", archLabel, err)
|
||||
continue
|
||||
}
|
||||
reflect.DeepEqual(itStruct.BuildPackages(), buildPackages[archLabel])
|
||||
assert.ElementsMatch(t, buildPackages[archLabel], itStruct.BuildPackages())
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue