[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:
Jiri Kortus 2020-05-12 16:43:19 +02:00 committed by Tom Gundersen
parent 4aeb6f2b28
commit cdcd09dd67
3 changed files with 3 additions and 6 deletions

View file

@ -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())
}
}
}

View file

@ -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())
}
}
}

View file

@ -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())
}
}
}