Skip to content

Commit

Permalink
Merge pull request #447 from iRevive/fix-attribute-props-test
Browse files Browse the repository at this point in the history
AttributesProps: use unique keys to compare the size
  • Loading branch information
iRevive authored Jan 20, 2024
2 parents 3019c64 + 213aef6 commit 0ecaa5b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,14 @@ class AttributesProps extends ScalaCheckSuite {
forAll(listOfAttributes, listOfAttributes) { (attributes1, attributes2) =>
val keySet1 = attributes1.map(_.key).toSet
val keySet2 = attributes2.map(_.key).toSet
val unique = keySet1 ++ keySet2
val diff = keySet1.intersect(keySet2)

val attrs1 = Attributes(attributes1: _*)
val attrs2 = Attributes(attributes2: _*)

val combined = attrs1 ++ attrs2
val sizeIsEqual = combined.size == keySet1.size + keySet2.size
val sizeIsEqual = combined.size == unique.size

val secondCollectionOverrodeValues = diff.forall { key =>
combined.get(key).contains(attrs2.get(key).get)
Expand Down

0 comments on commit 0ecaa5b

Please sign in to comment.