From 7fe4b3b61269066a8da86832a60371d23d9732c3 Mon Sep 17 00:00:00 2001 From: ragnar Date: Tue, 17 Dec 2024 17:35:26 +0100 Subject: [PATCH] =?UTF-8?q?don=E2=80=99t=20require=20subsumption=20normali?= =?UTF-8?q?zation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../test/rdts/baseproperties/DecomposePropertyChecks.scala | 4 ++-- .../src/test/scala/test/rdts/baseproperties/OrderTest.scala | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Modules/RDTs/src/test/scala/test/rdts/baseproperties/DecomposePropertyChecks.scala b/Modules/RDTs/src/test/scala/test/rdts/baseproperties/DecomposePropertyChecks.scala index 2571f69fd..2ea06b495 100644 --- a/Modules/RDTs/src/test/scala/test/rdts/baseproperties/DecomposePropertyChecks.scala +++ b/Modules/RDTs/src/test/scala/test/rdts/baseproperties/DecomposePropertyChecks.scala @@ -79,8 +79,8 @@ abstract class DecomposePropertyChecks[A]( s"naive order broken:\n ${d}\n $theValue\n${decomposed.mkString(" ", "\n ", "\n")}" ) assert( - Lattice[A].subsumption(d, theValue), - s"decompose not smaller: »$d« <= »$theValue«\nmerge: ${d `merge` theValue}" + Lattice[A].subsumption(d, normalized), + s"decompose not smaller: »$d« <= »$theValue«\nmerge: ${d `merge` normalized}" ) if decomposed.sizeIs > 1 then diff --git a/Modules/RDTs/src/test/scala/test/rdts/baseproperties/OrderTest.scala b/Modules/RDTs/src/test/scala/test/rdts/baseproperties/OrderTest.scala index 9f6b2b428..3f27aae16 100644 --- a/Modules/RDTs/src/test/scala/test/rdts/baseproperties/OrderTest.scala +++ b/Modules/RDTs/src/test/scala/test/rdts/baseproperties/OrderTest.scala @@ -2,6 +2,7 @@ package test.rdts.baseproperties import org.scalacheck.Arbitrary import org.scalacheck.Prop.* +import rdts.base.Lattice import rdts.time.{ArrayRanges, Dots, VectorClock} import test.rdts.DataGenerator.given @@ -17,7 +18,7 @@ class DotsOrderTest extends OrderTests[Dots](using Dots.partialOrder)(total = fa // the specification of these tests is nice, but the generators are essentially useless, as it is extremely unlikely // that they will produce any kind of comparable values -abstract class OrderTests[A: Arbitrary](using pa: PartialOrdering[A])(total: Boolean, agreesWithEquals: Boolean) +abstract class OrderTests[A: {Arbitrary, Lattice}](using pa: PartialOrdering[A])(total: Boolean, agreesWithEquals: Boolean) extends munit.ScalaCheckSuite { extension [A](using pa: PartialOrdering[A])(a: A) @@ -50,7 +51,7 @@ abstract class OrderTests[A: Arbitrary](using pa: PartialOrdering[A])(total: Boo property("reflexive") { forAll { (a: A) => - assert(a <= a) + assert(a <= Lattice.normalize(a)) } }