Skip to content

Commit

Permalink
Use let instead of mm
Browse files Browse the repository at this point in the history
  • Loading branch information
propensive committed Dec 6, 2023
1 parent f063773 commit 51451cc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/core/probably.scala
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ case class TestId(name: Text, suite: Maybe[TestSuite], codepoint: Codepoint):
val timestamp: Long = System.currentTimeMillis
import textWidthCalculation.uniform
lazy val id: Text = (suite.hashCode ^ name.hashCode).hex.pad(6, Rtl, '0').take(6, Rtl)
lazy val ids: List[Text] = id :: suite.mm(_.id.ids).or(Nil)
lazy val ids: List[Text] = id :: suite.let(_.id.ids).or(Nil)
def apply[T](ctx: TestContext ?=> T): Test[T] = Test[T](this, ctx(using _))
def depth: Int = suite.mm(_.id.depth).or(0) + 1
def depth: Int = suite.let(_.id.depth).or(0) + 1

class TestSuite(val name: Text, val parent: Maybe[TestSuite] = Unset)(using codepoint: Codepoint):
override def equals(that: Any): Boolean = that.matchable(using Unsafe) match
Expand Down
4 changes: 2 additions & 2 deletions src/core/report.scala
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ class TestReport(using Environment):

case class Summary(status: Status, id: TestId, count: Int, min: Long, max: Long, avg: Long):
def indentedName: Output =
val depth = id.suite.mm(_.id.depth).or(0) + 1
val depth = id.suite.let(_.id.depth).or(0) + 1

val title =
if status == Status.Suite then e"${colors.Silver}($Bold(${id.name}))"
Expand Down Expand Up @@ -384,7 +384,7 @@ class TestReport(using Environment):

benches(lines).groupBy(_.test.suite).foreach: (suite, benchmarks) =>
val ribbon = Ribbon(colors.DarkGreen.srgb, colors.MediumSeaGreen.srgb, colors.PaleGreen.srgb)
Out.println(ribbon.fill(e"${suite.mm(_.id.id).or(t"")}", e"Benchmarks", e"${suite.mm(_.name).or(t"")}"))
Out.println(ribbon.fill(e"${suite.let(_.id.id).or(t"")}", e"Benchmarks", e"${suite.let(_.name).or(t"")}"))

val comparisons: List[ReportLine.Bench] =
benchmarks.filter(!_.benchmark.baseline.unset).to(List)
Expand Down

0 comments on commit 51451cc

Please sign in to comment.