Skip to content

Commit

Permalink
don’t require subsumption normalization
Browse files Browse the repository at this point in the history
  • Loading branch information
rmgk committed Dec 17, 2024
1 parent 4c96463 commit 7fe4b3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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)
Expand Down Expand Up @@ -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))
}
}

Expand Down

0 comments on commit 7fe4b3b

Please sign in to comment.