[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
|
package fedora30_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/osbuild/osbuild-composer/internal/distro/distro_test_common"
|
"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)
|
t.Errorf("d.GetArch(%v) returned err = %v; expected nil", archLabel, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
reflect.DeepEqual(itStruct.BuildPackages(), buildPackages[archLabel])
|
assert.ElementsMatch(t, buildPackages[archLabel], itStruct.BuildPackages())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package fedora31_test
|
package fedora31_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/osbuild/osbuild-composer/internal/distro/distro_test_common"
|
"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)
|
t.Errorf("d.GetArch(%v) returned err = %v; expected nil", archLabel, err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
reflect.DeepEqual(itStruct.BuildPackages(), buildPackages[archLabel])
|
assert.ElementsMatch(t, buildPackages[archLabel], itStruct.BuildPackages())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package fedora32_test
|
package fedora32_test
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"reflect"
|
|
||||||
"testing"
|
"testing"
|
||||||
|
|
||||||
"github.com/osbuild/osbuild-composer/internal/distro/distro_test_common"
|
"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)
|
t.Errorf("d.GetArch(%v) returned err = %v; expected nil", archLabel, err)
|
||||||
continue
|
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