diff --git a/jvm/core/src/main/scala/org/scalatest/Doc.scala b/jvm/core/src/main/scala/org/scalatest/Doc.scala
index a7fb33a8fb..542e4d9228 100644
--- a/jvm/core/src/main/scala/org/scalatest/Doc.scala
+++ b/jvm/core/src/main/scala/org/scalatest/Doc.scala
@@ -109,7 +109,10 @@ private[scalatest] trait Doc extends Suite { thisDoc =>
* Returns a list containing the suites mentioned in the body XML element,
* in the order they were mentioned.
*/
- final override lazy val nestedSuites: collection.immutable.IndexedSeq[Suite] = for (IncludedSuite(suite) <- snippets) yield suite
+ final override lazy val nestedSuites: collection.immutable.IndexedSeq[Suite] =
+ snippets.collect {
+ case IncludedSuite(suite) => suite
+ }
/*
println("^^^^^^^^^^^")
println(body.text)
diff --git a/jvm/core/src/main/scala/org/scalatest/concurrent/Conductors.scala b/jvm/core/src/main/scala/org/scalatest/concurrent/Conductors.scala
index 31145ed60a..859f3820d3 100644
--- a/jvm/core/src/main/scala/org/scalatest/concurrent/Conductors.scala
+++ b/jvm/core/src/main/scala/org/scalatest/concurrent/Conductors.scala
@@ -1111,7 +1111,7 @@ trait Conductors extends PatienceConfiguration {
private def detectDeadlock(): Unit = {
// Should never get to >= before ==, but just playing it safe
if (deadlockCount >= MaxDeadlockDetectionsBeforeDeadlock) {
- val errorMessage = Resources.suspectedDeadlock(MaxDeadlockDetectionsBeforeDeadlock.toString, (clockInterval scaledBy MaxDeadlockDetectionsBeforeDeadlock).prettyString)
+ val errorMessage = Resources.suspectedDeadlock(MaxDeadlockDetectionsBeforeDeadlock.toString, (clockInterval.scaledBy(MaxDeadlockDetectionsBeforeDeadlock)).prettyString)
firstExceptionThrown offer new RuntimeException(errorMessage)
// The mainThread is likely joined to some test thread, so wake it up. It will look and
diff --git a/jvm/core/src/main/scala/org/scalatest/concurrent/ScaledTimeSpans.scala b/jvm/core/src/main/scala/org/scalatest/concurrent/ScaledTimeSpans.scala
index 48d6f6f487..8b3d055c9b 100644
--- a/jvm/core/src/main/scala/org/scalatest/concurrent/ScaledTimeSpans.scala
+++ b/jvm/core/src/main/scala/org/scalatest/concurrent/ScaledTimeSpans.scala
@@ -182,7 +182,7 @@ trait ScaledTimeSpans {
* @throws IllegalArgumentException if the value returned from spanScaleFactor
* is less than zero
*/
- final def scaled(span: Span): Span = span scaledBy spanScaleFactor
+ final def scaled(span: Span): Span = span.scaledBy(spanScaleFactor)
/**
* The factor by which the scaled
method will scale Span
s.
diff --git a/jvm/core/src/main/scala/org/scalatest/enablers/Retrying.scala b/jvm/core/src/main/scala/org/scalatest/enablers/Retrying.scala
index 7594b6434f..0dd0c67db6 100644
--- a/jvm/core/src/main/scala/org/scalatest/enablers/Retrying.scala
+++ b/jvm/core/src/main/scala/org/scalatest/enablers/Retrying.scala
@@ -78,7 +78,7 @@ object Retrying {
def retry(timeout: Span, interval: Span, pos: source.Position)(fun: => Future[T]): Future[T] = {
val startNanos = System.nanoTime
- val initialInterval = Span(interval.totalNanos * 0.1, Nanoseconds) // config.interval scaledBy 0.1
+ val initialInterval = Span(interval.totalNanos * 0.1, Nanoseconds)
// Can't make this tail recursive. TODO: Document that fact.
def tryTryAgain(attempt: Int): Future[T] = {
@@ -120,7 +120,7 @@ object Retrying {
promise.future
}
else { // Timed out so return a failed Future
- val durationSpan = Span(1, Nanosecond) scaledBy duration // Use scaledBy to get pretty units
+ val durationSpan = Span(1, Nanosecond).scaledBy(duration) // Use scaledBy to get pretty units
Future.failed(
new TestFailedDueToTimeoutException(
(_: StackDepthException) =>
@@ -150,7 +150,7 @@ object Retrying {
Thread.sleep(interval.millisPart, interval.nanosPart)
}
else {
- val durationSpan = Span(1, Nanosecond) scaledBy duration // Use scaledBy to get pretty units
+ val durationSpan = Span(1, Nanosecond).scaledBy(duration) // Use scaledBy to get pretty units
throw new TestFailedDueToTimeoutException(
(_: StackDepthException) =>
Some(
@@ -189,7 +189,7 @@ object Retrying {
}
}
- val initialInterval = Span(interval.totalNanos * 0.1, Nanoseconds) // config.interval scaledBy 0.1
+ val initialInterval = Span(interval.totalNanos * 0.1, Nanoseconds)
@tailrec
def tryTryAgain(attempt: Int): T = {
@@ -204,7 +204,7 @@ object Retrying {
Thread.sleep(interval.millisPart, interval.nanosPart)
}
else {
- val durationSpan = Span(1, Nanosecond) scaledBy duration // Use scaledBy to get pretty units
+ val durationSpan = Span(1, Nanosecond).scaledBy(duration) // Use scaledBy to get pretty units
throw new TestFailedDueToTimeoutException(
(_: StackDepthException) =>
Some(
diff --git a/jvm/core/src/main/scala/org/scalatest/tools/SuiteDiscoveryHelper.scala b/jvm/core/src/main/scala/org/scalatest/tools/SuiteDiscoveryHelper.scala
index 5f7a495561..9dcd053b89 100644
--- a/jvm/core/src/main/scala/org/scalatest/tools/SuiteDiscoveryHelper.scala
+++ b/jvm/core/src/main/scala/org/scalatest/tools/SuiteDiscoveryHelper.scala
@@ -273,17 +273,8 @@ private[scalatest] object SuiteDiscoveryHelper {
//
private def processFileNames(fileNames: Iterator[String], fileSeparator: Char, loader: ClassLoader,
suffixes: Option[Pattern]): Set[String] =
- {
- val classNameOptions = // elements are Some(FlatSpec
, or WordSpec
.
*
"can"
, and right, and returns the result.
*
*/
+ //DOTTY-ONLY infix
def can(right: String)(implicit svsi: StringVerbStringInvocation): ResultOfStringPassedToVerb = {
svsi(leftSideString, "can", right, pos)
}
@@ -139,6 +140,7 @@ trait CanVerb {
* simply invokes this function, passing in leftSideString, and returns the result.
*
*/
+ //DOTTY-ONLY infix
def can(right: BehaveWord)(implicit svbli: StringVerbBehaveLikeInvocation): BehaveWord = {
svbli(leftSideString, pos)
}
@@ -165,6 +167,7 @@ trait CanVerb {
* no-arg function.
*
*/
+ //DOTTY-ONLY infix
def can(right: => Unit)(implicit fun: StringVerbBlockRegistration): Unit = {
fun(leftSideString, "can", pos, () => right)
}
@@ -192,6 +195,7 @@ trait CanVerb {
* "can"
, and the ResultOfAfterWordApplication
passed to can
.
*
*/
+ //DOTTY-ONLY infix
def can(resultOfAfterWordApplication: ResultOfAfterWordApplication)(implicit swawr: SubjectWithAfterWordRegistration): Unit = {
swawr(leftSideString, "can", resultOfAfterWordApplication, pos)
}
diff --git a/jvm/core/src/main/scala/org/scalatest/verbs/MustVerb.scala b/jvm/core/src/main/scala/org/scalatest/verbs/MustVerb.scala
index 711680c21b..b32b396b2c 100644
--- a/jvm/core/src/main/scala/org/scalatest/verbs/MustVerb.scala
+++ b/jvm/core/src/main/scala/org/scalatest/verbs/MustVerb.scala
@@ -138,6 +138,7 @@ trait MustVerb {
* "must"
, and right, and returns the result.
*
*/
+ //DOTTY-ONLY infix
def must(right: String)(implicit svsi: StringVerbStringInvocation): ResultOfStringPassedToVerb = {
svsi(leftSideString, "must", right, pos)
}
@@ -161,6 +162,7 @@ trait MustVerb {
* simply invokes this function, passing in leftSideString, and returns the result.
*
*/
+ //DOTTY-ONLY infix
def must(right: BehaveWord)(implicit svbli: StringVerbBehaveLikeInvocation): BehaveWord = {
svbli(leftSideString, pos)
}
@@ -187,6 +189,7 @@ trait MustVerb {
* no-arg function.
*
*/
+ //DOTTY-ONLY infix
def must(right: => Unit)(implicit fun: StringVerbBlockRegistration): Unit = {
fun(leftSideString, "must", pos, () => right)
}
@@ -214,6 +217,7 @@ trait MustVerb {
* "must"
, and the ResultOfAfterWordApplication
passed to must
.
*
*/
+ //DOTTY-ONLY infix
def must(resultOfAfterWordApplication: ResultOfAfterWordApplication)(implicit swawr: SubjectWithAfterWordRegistration): Unit = {
swawr(leftSideString, "must", resultOfAfterWordApplication, pos)
}
diff --git a/jvm/core/src/main/scala/org/scalatest/verbs/ResultOfStringPassedToVerb.scala b/jvm/core/src/main/scala/org/scalatest/verbs/ResultOfStringPassedToVerb.scala
index 079f343928..0811e9031d 100644
--- a/jvm/core/src/main/scala/org/scalatest/verbs/ResultOfStringPassedToVerb.scala
+++ b/jvm/core/src/main/scala/org/scalatest/verbs/ResultOfStringPassedToVerb.scala
@@ -86,6 +86,7 @@ abstract class ResultOfStringPassedToVerb(val verb: String, val rest: String) {
* for trait FlatSpec
.
*
*/
+ //DOTTY-ONLY infix
def is(fun: => PendingStatement): Unit
/**
@@ -105,5 +106,6 @@ abstract class ResultOfStringPassedToVerb(val verb: String, val rest: String) {
* for trait FlatSpec
.
*
*/
+ //DOTTY-ONLY infix
def taggedAs(firstTestTag: Tag, otherTestTags: Tag*): ResultOfTaggedAsInvocation
}
diff --git a/jvm/core/src/main/scala/org/scalatest/verbs/ResultOfTaggedAsInvocation.scala b/jvm/core/src/main/scala/org/scalatest/verbs/ResultOfTaggedAsInvocation.scala
index cd3a351115..adb2a701d5 100644
--- a/jvm/core/src/main/scala/org/scalatest/verbs/ResultOfTaggedAsInvocation.scala
+++ b/jvm/core/src/main/scala/org/scalatest/verbs/ResultOfTaggedAsInvocation.scala
@@ -79,5 +79,6 @@ abstract class ResultOfTaggedAsInvocation(val verb: String, val rest: String, va
* in the main documentation for trait FlatSpec
.
*
*/
+ //DOTTY-ONLY infix
def is(testFun: => PendingStatement): Unit
}
diff --git a/jvm/core/src/main/scala/org/scalatest/verbs/ShouldVerb.scala b/jvm/core/src/main/scala/org/scalatest/verbs/ShouldVerb.scala
index 4c920cce61..fb9df6e71b 100644
--- a/jvm/core/src/main/scala/org/scalatest/verbs/ShouldVerb.scala
+++ b/jvm/core/src/main/scala/org/scalatest/verbs/ShouldVerb.scala
@@ -141,6 +141,7 @@ trait ShouldVerb {
* "should"
, and right, and returns the result.
*
*/
+ //DOTTY-ONLY infix
def should(right: String)(implicit svsi: StringVerbStringInvocation): ResultOfStringPassedToVerb = {
svsi(leftSideString, "should", right, pos)
}
@@ -164,6 +165,7 @@ trait ShouldVerb {
* simply invokes this function, passing in leftSideString, and returns the result.
*
*/
+ //DOTTY-ONLY infix
def should(right: BehaveWord)(implicit svbli: StringVerbBehaveLikeInvocation): BehaveWord = {
svbli(leftSideString, pos)
}
@@ -190,6 +192,7 @@ trait ShouldVerb {
* no-arg function.
*
*/
+ //DOTTY-ONLY infix
def should(right: => Unit)(implicit fun: StringVerbBlockRegistration): Unit = {
fun(leftSideString, "should", pos, () => right)
}
@@ -217,6 +220,7 @@ trait ShouldVerb {
* "should"
, and the ResultOfAfterWordApplication
passed to should
.
*
*/
+ //DOTTY-ONLY infix
def should(resultOfAfterWordApplication: ResultOfAfterWordApplication)(implicit swawr: SubjectWithAfterWordRegistration): Unit = {
swawr(leftSideString, "should", resultOfAfterWordApplication, pos)
}
diff --git a/jvm/core/src/main/scala/org/scalatest/verbs/WillVerb.scala b/jvm/core/src/main/scala/org/scalatest/verbs/WillVerb.scala
index ec1ccbdd66..f7c3aea0e1 100644
--- a/jvm/core/src/main/scala/org/scalatest/verbs/WillVerb.scala
+++ b/jvm/core/src/main/scala/org/scalatest/verbs/WillVerb.scala
@@ -141,6 +141,7 @@ private[scalatest] trait WillVerb {
* "will"
, and right, and returns the result.
*
*/
+ //DOTTY-ONLY infix
def will(right: String)(implicit svsi: StringVerbStringInvocation): ResultOfStringPassedToVerb = {
svsi(leftSideString, "will", right, pos)
}
@@ -164,6 +165,7 @@ private[scalatest] trait WillVerb {
* simply invokes this function, passing in leftSideString, and returns the result.
*
*/
+ //DOTTY-ONLY infix
def will(right: BehaveWord)(implicit svbli: StringVerbBehaveLikeInvocation): BehaveWord = {
svbli(leftSideString, pos)
}
@@ -190,6 +192,7 @@ private[scalatest] trait WillVerb {
* no-arg function.
*
*/
+ //DOTTY-ONLY infix
def will(right: => Unit)(implicit fun: StringVerbBlockRegistration): Unit = {
fun(leftSideString, "will", pos, () => right)
}
@@ -217,6 +220,7 @@ private[scalatest] trait WillVerb {
* "will"
, and the ResultOfAfterWordApplication
passed to will
.
*
*/
+ //DOTTY-ONLY infix
def will(resultOfAfterWordApplication: ResultOfAfterWordApplication)(implicit swawr: SubjectWithAfterWordRegistration): Unit = {
swawr(leftSideString, "will", resultOfAfterWordApplication, pos)
}
diff --git a/jvm/scalactic-macro/src/main/scala/org/scalactic/Or.scala b/jvm/scalactic-macro/src/main/scala/org/scalactic/Or.scala
index 46424d4aa6..5834454033 100644
--- a/jvm/scalactic-macro/src/main/scala/org/scalactic/Or.scala
+++ b/jvm/scalactic-macro/src/main/scala/org/scalactic/Or.scala
@@ -578,6 +578,7 @@ import scala.collection.mutable.Builder
* ScalaKittens.
*
*/
+//DOTTY-ONLY infix
sealed abstract class Or[+G,+B] extends Product with Serializable {
/**
diff --git a/jvm/scalactic/src/main/scala/org/scalactic/CanEqual.scala b/jvm/scalactic/src/main/scala/org/scalactic/CanEqual.scala
index 234fcf1ddd..e858cf6328 100644
--- a/jvm/scalactic/src/main/scala/org/scalactic/CanEqual.scala
+++ b/jvm/scalactic/src/main/scala/org/scalactic/CanEqual.scala
@@ -25,6 +25,7 @@ import annotation.implicitNotFound
*
*/
@implicitNotFound(msg = "types ${A} and ${B} do not adhere to the type constraint selected for the === and !== operators; the missing implicit parameter is of type org.scalactic.CanEqual[${A},${B}]")
+//DOTTY-ONLY infix
abstract class CanEqual[A, B] {
/**
diff --git a/jvm/scalactic/src/main/scala/org/scalactic/Explicitly.scala b/jvm/scalactic/src/main/scala/org/scalactic/Explicitly.scala
index e9b1081c80..5cb1bcded8 100644
--- a/jvm/scalactic/src/main/scala/org/scalactic/Explicitly.scala
+++ b/jvm/scalactic/src/main/scala/org/scalactic/Explicitly.scala
@@ -98,6 +98,7 @@ trait Explicitly {
* ^
*
*/
+ //DOTTY-ONLY infix
def by[A](equality: Equality[A]): DecidedByEquality[A] = new DecidedByEquality[A](equality)
}
@@ -130,6 +131,7 @@ trait Explicitly {
*
*
*/
+ //DOTTY-ONLY infix
def by[A](equivalence: Equivalence[A]): DeterminedByEquivalence[A] = new DeterminedByEquivalence[A](equivalence)
}
@@ -187,6 +189,7 @@ trait Explicitly {
* before comparing them for equality using the Equality[A]
passed to this object's
* constructor.
*/
+ //DOTTY-ONLY infix
def afterBeing(uniformity: Uniformity[A]): NormalizingEquality[A] =
new ComposedNormalizingEquality[A](equality, uniformity)
}
@@ -234,6 +237,7 @@ trait Explicitly {
* before comparing them for equality using the Equivalence[T]
passed to this object's
* constructor.
*/
+ //DOTTY-ONLY infix
def afterBeing(normalization: Normalization[T]): NormalizingEquivalence[T] =
new ComposedNormalizingEquivalence[T](equivalence, normalization)
}
@@ -259,6 +263,7 @@ trait Explicitly {
* before comparing it for equality with another N
using the implicitly
* passed Equality[N]
.
*/
+ //DOTTY-ONLY infix
def being[N](uniformity: Uniformity[N])(implicit equality: Equality[N]): NormalizingEquality[N] =
new ComposedNormalizingEquality[N](equality, uniformity)
@@ -277,6 +282,7 @@ trait Explicitly {
* before comparing it for equality with another N
using the implicitly
* passed Equivalence[N]
.
*/
+ //DOTTY-ONLY infix
def being[N](normalization: Normalization[N])(implicit equivalence: Equivalence[N]): NormalizingEquivalence[N] =
new ComposedNormalizingEquivalence[N](equivalence, normalization)
}
diff --git a/jvm/scalactic/src/main/scala/org/scalactic/Normalization.scala b/jvm/scalactic/src/main/scala/org/scalactic/Normalization.scala
index cda92da319..569bb5a5e9 100644
--- a/jvm/scalactic/src/main/scala/org/scalactic/Normalization.scala
+++ b/jvm/scalactic/src/main/scala/org/scalactic/Normalization.scala
@@ -98,6 +98,7 @@ trait Normalization[A] { thisNormalization =>
* @param other a Normalization
to 'and' with this one
* @return a Normalization
representing the composition of this and the passed Normalization
*/
+ //DOTTY-ONLY infix
final def and(other: Normalization[A]): Normalization[A] =
new Normalization[A] {
def normalized(a: A): A = other.normalized(thisNormalization.normalized(a))
diff --git a/jvm/scalactic/src/main/scala/org/scalactic/NormalizingEquality.scala b/jvm/scalactic/src/main/scala/org/scalactic/NormalizingEquality.scala
index c3bea85c09..7ad581b882 100644
--- a/jvm/scalactic/src/main/scala/org/scalactic/NormalizingEquality.scala
+++ b/jvm/scalactic/src/main/scala/org/scalactic/NormalizingEquality.scala
@@ -142,6 +142,7 @@ trait NormalizingEquality[A] extends Equality[A] { thisNormEq =>
* @param other a Uniformity
to 'and' with this one
* @return a NormalizingEquality
representing the composition of this and the passed Uniformity
*/
+ //DOTTY-ONLY infix
final def and(other: Uniformity[A]): NormalizingEquality[A] =
new ComposedNormalizingEquality[A](afterNormalizationEquality, this.toUniformity and other)
diff --git a/jvm/scalactic/src/main/scala/org/scalactic/NormalizingEquivalence.scala b/jvm/scalactic/src/main/scala/org/scalactic/NormalizingEquivalence.scala
index a17f9c2de7..6067ef30a9 100644
--- a/jvm/scalactic/src/main/scala/org/scalactic/NormalizingEquivalence.scala
+++ b/jvm/scalactic/src/main/scala/org/scalactic/NormalizingEquivalence.scala
@@ -79,6 +79,7 @@ trait NormalizingEquivalence[A] extends Equivalence[A] { thisNormEq =>
* @param a the object to normalize
* @return the normalized form of the passed object
*/
+ //DOTTY-ONLY infix
def normalized(a: A): A
/**
@@ -98,6 +99,7 @@ trait NormalizingEquivalence[A] extends Equivalence[A] { thisNormEq =>
* @param other a Normalization
to 'and' with this one
* @return a NormalizingEquivalence
representing the composition of this and the passed Normalization
*/
+ //DOTTY-ONLY infix
final def and(other: Normalization[A]): NormalizingEquivalence[A] =
new ComposedNormalizingEquivalence[A](afterNormalizationEquivalence, this.toNormalization and other)
diff --git a/jvm/scalactic/src/main/scala/org/scalactic/Uniformity.scala b/jvm/scalactic/src/main/scala/org/scalactic/Uniformity.scala
index 108ccc43b3..ebccee8a31 100644
--- a/jvm/scalactic/src/main/scala/org/scalactic/Uniformity.scala
+++ b/jvm/scalactic/src/main/scala/org/scalactic/Uniformity.scala
@@ -73,7 +73,7 @@ package org.scalactic
*
*
* @tparam A the type whose uniformity is being defined
- */
+ */
trait Uniformity[A] extends Normalization[A] { thisUniformity =>
/**
@@ -214,6 +214,7 @@ trait Uniformity[A] extends Normalization[A] { thisUniformity =>
* @param other a Uniformity
to 'and' with this one
* @return a Uniformity
representing the composition of this and the passed Uniformity
*/
+ //DOTTY-ONLY infix
final def and(other: Uniformity[A]): Uniformity[A] =
new Uniformity[A] {
// Note in Scaladoc what order, and recommend people don't do side effects anyway.
diff --git a/jvm/scalatest-test/src/test/scala/org/scalatest/time/SpanSpec.scala b/jvm/scalatest-test/src/test/scala/org/scalatest/time/SpanSpec.scala
index 23bdc70d7f..4485bd5194 100644
--- a/jvm/scalatest-test/src/test/scala/org/scalatest/time/SpanSpec.scala
+++ b/jvm/scalatest-test/src/test/scala/org/scalatest/time/SpanSpec.scala
@@ -737,45 +737,45 @@ class SpanSpec extends AnyFunSpec with Matchers with SpanMatchers {
describe("when scaled via the scaleBy method") {
it("should throw IllegalArgumentException when a negative number is passed") {
intercept[IllegalArgumentException] {
- Span(1, Second) scaledBy -1
+ Span(1, Second).scaledBy(-1)
}
intercept[IllegalArgumentException] {
- Span(1, Second) scaledBy -1.0
+ Span(1, Second).scaledBy(-1.0)
}
}
it("should return the exact same Span when 1 is passed") {
val span = Span(1, Second)
- assert(span scaledBy 1 eq span)
- assert(span scaledBy 1.0 eq span)
+ assert(span.scaledBy(1) eq span)
+ assert(span.scaledBy(1.0) eq span)
}
it("should return an zero-length Span when 0 is passed") {
- assert((Span(1, Second) scaledBy 0) === Span.Zero)
- assert((Span(1, Second) scaledBy 0.0) === Span.Zero)
+ assert((Span(1, Second).scaledBy(0)) === Span.Zero)
+ assert((Span(1, Second).scaledBy(0.0)) === Span.Zero)
}
it("should give correct results when only operating in the nanosPart") {
- assert((Span(1, Nanosecond) scaledBy 100) === Span(100, Nanoseconds))
- assert((Span(1, Nanosecond) scaledBy 100.0) === Span(100, Nanoseconds))
+ assert((Span(1, Nanosecond).scaledBy(100)) === Span(100, Nanoseconds))
+ assert((Span(1, Nanosecond).scaledBy(100.0)) === Span(100, Nanoseconds))
}
it("should give correct results when only operating in the millisPart") {
- assert((Span(1, Millisecond) scaledBy 100) === Span(100, Milliseconds))
- assert((Span(1, Millisecond) scaledBy 100.0) === Span(100, Milliseconds))
+ assert((Span(1, Millisecond).scaledBy(100)) === Span(100, Milliseconds))
+ assert((Span(1, Millisecond).scaledBy(100.0)) === Span(100, Milliseconds))
}
it("should give Span.Max when overflow occurs") {
- assert((Span.Max scaledBy 2) === Span.Max)
- assert((Span.Max scaledBy 2.0) === Span.Max)
+ assert((Span.Max.scaledBy(2)) === Span.Max)
+ assert((Span.Max.scaledBy(2.0)) === Span.Max)
}
it("should give Span.Zero if less than 1 nanosecond") {
- assert((Span(1, Nanosecond) scaledBy 0.1) === Span.Zero)
+ assert((Span(1, Nanosecond).scaledBy(0.1)) === Span.Zero)
}
it("should be 0 Nanoseconds if zero length span") {
{
- val span = Span(1, Day) scaledBy 0
+ val span = Span(1, Day).scaledBy(0)
assert(span === Span(0, Nanoseconds))
assert(span.toString === "Span(0, Nanoseconds)")
assert(span.prettyString === "0 nanoseconds")
}
{
- val span = Span(0, Nanoseconds) scaledBy 100
+ val span = Span(0, Nanoseconds).scaledBy(100)
assert(span === Span(0, Nanoseconds))
assert(span.toString === "Span(0, Nanoseconds)")
assert(span.prettyString === "0 nanoseconds")
@@ -783,25 +783,25 @@ class SpanSpec extends AnyFunSpec with Matchers with SpanMatchers {
}
it("should have nanosecond units if < 1000 nanoseconds") {
{
- val span = Span(100, Nanoseconds) scaledBy 0.01
+ val span = Span(100, Nanoseconds).scaledBy(0.01)
assert(span === Span(1, Nanosecond))
assert(span.toString === "Span(1, Nanosecond)")
assert(span.prettyString === "1 nanosecond")
}
{
- val span = Span(100, Nanoseconds) scaledBy 5
+ val span = Span(100, Nanoseconds).scaledBy(5)
assert(span === Span(500, Nanoseconds))
assert(span.toString === "Span(500, Nanoseconds)")
assert(span.prettyString === "500 nanoseconds")
}
{
- val span = Span(100, Nanoseconds) scaledBy 5.001
+ val span = Span(100, Nanoseconds).scaledBy(5.001)
assert(span === Span(500.1, Nanoseconds))
assert(span.toString === "Span(500.1, Nanoseconds)")
assert(span.prettyString === "500.1 nanoseconds")
}
{
- val span = Span(1, Nanosecond) scaledBy 999
+ val span = Span(1, Nanosecond).scaledBy(999)
assert(span === Span(999, Nanoseconds))
assert(span.toString === "Span(999, Nanoseconds)")
assert(span.prettyString === "999 nanoseconds")
@@ -809,31 +809,31 @@ class SpanSpec extends AnyFunSpec with Matchers with SpanMatchers {
}
it("should have microsecond units if > 1 and < 1000 microseconds") {
{
- val span = Span(1, Nanosecond) scaledBy 1000
+ val span = Span(1, Nanosecond).scaledBy(1000)
assert(span === Span(1, Microsecond))
assert(span.toString === "Span(1, Microsecond)")
assert(span.prettyString === "1 microsecond")
}
{
- val span = Span(100, Microseconds) scaledBy 0.01
+ val span = Span(100, Microseconds).scaledBy(0.01)
assert(span === Span(1, Microsecond))
assert(span.toString === "Span(1, Microsecond)")
assert(span.prettyString === "1 microsecond")
}
{
- val span = Span(100, Microseconds) scaledBy 5
+ val span = Span(100, Microseconds).scaledBy(5)
assert(span === Span(500, Microseconds))
assert(span.toString === "Span(500, Microseconds)")
assert(span.prettyString === "500 microseconds")
}
{
- val span = Span(3, Microseconds) scaledBy 0.5
+ val span = Span(3, Microseconds).scaledBy(0.5)
assert(span === Span(1.5, Microseconds))
assert(span.toString === "Span(1.5, Microseconds)")
assert(span.prettyString === "1.5 microseconds")
}
{
- val span = Span(1, Microsecond) scaledBy 999
+ val span = Span(1, Microsecond).scaledBy(999)
assert(span === Span(999, Microseconds))
assert(span.toString === "Span(999, Microseconds)")
assert(span.prettyString === "999 microseconds")
@@ -841,31 +841,31 @@ class SpanSpec extends AnyFunSpec with Matchers with SpanMatchers {
}
it("should have millisecond units if > 1 and < 1000 milliseconds") {
{
- val span = Span(1, Microsecond) scaledBy 1000
+ val span = Span(1, Microsecond).scaledBy(1000)
assert(span === Span(1, Millisecond))
assert(span.toString === "Span(1, Millisecond)")
assert(span.prettyString === "1 millisecond")
}
{
- val span = Span(100, Millis) scaledBy 0.01
+ val span = Span(100, Millis).scaledBy(0.01)
assert(span === Span(1, Millisecond))
assert(span.toString === "Span(1, Millisecond)")
assert(span.prettyString === "1 millisecond")
}
{
- val span = Span(100, Millis) scaledBy 5
+ val span = Span(100, Millis).scaledBy(5)
assert(span === Span(500, Millis))
assert(span.toString === "Span(500, Millis)")
assert(span.prettyString === "500 milliseconds")
}
{
- val span = Span(3, Millis) scaledBy 0.5
+ val span = Span(3, Millis).scaledBy(0.5)
assert(span === Span(1.5, Millis))
assert(span.toString === "Span(1.5, Millis)")
assert(span.prettyString === "1.5 milliseconds")
}
{
- val span = Span(1, Millisecond) scaledBy 999
+ val span = Span(1, Millisecond).scaledBy(999)
assert(span === Span(999, Millis))
assert(span.toString === "Span(999, Millis)")
assert(span.prettyString === "999 milliseconds")
@@ -873,31 +873,31 @@ class SpanSpec extends AnyFunSpec with Matchers with SpanMatchers {
}
it("should have second units if > 1 and < 60 seconds") {
{
- val span = Span(1, Millisecond) scaledBy 1000
+ val span = Span(1, Millisecond).scaledBy(1000)
assert(span === Span(1, Second))
assert(span.toString === "Span(1, Second)")
assert(span.prettyString === "1 second")
}
{
- val span = Span(100, Seconds) scaledBy 0.01
+ val span = Span(100, Seconds).scaledBy(0.01)
assert(span === Span(1, Second))
assert(span.toString === "Span(1, Second)")
assert(span.prettyString === "1 second")
}
{
- val span = Span(10, Seconds) scaledBy 5
+ val span = Span(10, Seconds).scaledBy(5)
assert(span === Span(50, Seconds))
assert(span.toString === "Span(50, Seconds)")
assert(span.prettyString === "50 seconds")
}
{
- val span = Span(3, Seconds) scaledBy 0.5
+ val span = Span(3, Seconds).scaledBy(0.5)
assert(span === Span(1.5, Seconds))
assert(span.toString === "Span(1.5, Seconds)")
assert(span.prettyString === "1.5 seconds")
}
{
- val span = Span(1, Second) scaledBy 59
+ val span = Span(1, Second).scaledBy(59)
assert(span === Span(59, Seconds))
assert(span.toString === "Span(59, Seconds)")
assert(span.prettyString === "59 seconds")
@@ -905,31 +905,31 @@ class SpanSpec extends AnyFunSpec with Matchers with SpanMatchers {
}
it("should have minute units if > 1 and < 60 minutes") {
{
- val span = Span(1, Second) scaledBy 60
+ val span = Span(1, Second).scaledBy(60)
assert(span === Span(1, Minute))
assert(span.toString === "Span(1, Minute)")
assert(span.prettyString === "1 minute")
}
{
- val span = Span(100, Minutes) scaledBy 0.01
+ val span = Span(100, Minutes).scaledBy(0.01)
assert(span === Span(1, Minute))
assert(span.toString === "Span(1, Minute)")
assert(span.prettyString === "1 minute")
}
{
- val span = Span(10, Minutes) scaledBy 5
+ val span = Span(10, Minutes).scaledBy(5)
assert(span === Span(50, Minutes))
assert(span.toString === "Span(50, Minutes)")
assert(span.prettyString === "50 minutes")
}
{
- val span = Span(3, Minutes) scaledBy 0.5
+ val span = Span(3, Minutes).scaledBy(0.5)
assert(span === Span(1.5, Minutes))
assert(span.toString === "Span(1.5, Minutes)")
assert(span.prettyString === "1.5 minutes")
}
{
- val span = Span(1, Minute) scaledBy 59
+ val span = Span(1, Minute).scaledBy(59)
assert(span === Span(59, Minutes))
assert(span.toString === "Span(59, Minutes)")
assert(span.prettyString === "59 minutes")
@@ -937,31 +937,31 @@ class SpanSpec extends AnyFunSpec with Matchers with SpanMatchers {
}
it("should have hour units if > 1 and < 24 hours") {
{
- val span = Span(1, Minute) scaledBy 60
+ val span = Span(1, Minute).scaledBy(60)
assert(span === Span(1, Hour))
assert(span.toString === "Span(1, Hour)")
assert(span.prettyString === "1 hour")
}
{
- val span = Span(100, Hours) scaledBy 0.01
+ val span = Span(100, Hours).scaledBy(0.01)
assert(span === Span(1, Hour))
assert(span.toString === "Span(1, Hour)")
assert(span.prettyString === "1 hour")
}
{
- val span = Span(3, Hours) scaledBy 4
+ val span = Span(3, Hours).scaledBy(4)
assert(span === Span(12, Hours))
assert(span.toString === "Span(12, Hours)")
assert(span.prettyString === "12 hours")
}
{
- val span = Span(3, Hours) scaledBy 0.5
+ val span = Span(3, Hours).scaledBy(0.5)
assert(span === Span(1.5, Hours))
assert(span.toString === "Span(1.5, Hours)")
assert(span.prettyString === "1.5 hours")
}
{
- val span = Span(1, Hours) scaledBy 23
+ val span = Span(1, Hours).scaledBy(23)
assert(span === Span(23, Hours))
assert(span.toString === "Span(23, Hours)")
assert(span.prettyString === "23 hours")
@@ -969,31 +969,31 @@ class SpanSpec extends AnyFunSpec with Matchers with SpanMatchers {
}
it("should have day units if > 1 and < ? days") {
{
- val span = Span(1, Hour) scaledBy 24
+ val span = Span(1, Hour).scaledBy(24)
assert(span === Span(1, Day))
assert(span.toString === "Span(1, Day)")
assert(span.prettyString === "1 day")
}
{
- val span = Span(100, Days) scaledBy 0.01
+ val span = Span(100, Days).scaledBy(0.01)
assert(span === Span(1, Day))
assert(span.toString === "Span(1, Day)")
assert(span.prettyString === "1 day")
}
{
- val span = Span(3, Days) scaledBy 4
+ val span = Span(3, Days).scaledBy(4)
assert(span === Span(12, Days))
assert(span.toString === "Span(12, Days)")
assert(span.prettyString === "12 days")
}
{
- val span = Span(3, Days) scaledBy 0.5
+ val span = Span(3, Days).scaledBy(0.5)
assert(span === Span(1.5, Days))
assert(span.toString === "Span(1.5, Days)")
assert(span.prettyString === "1.5 days")
}
{
- val span = Span(53376, Days) scaledBy 2
+ val span = Span(53376, Days).scaledBy(2)
assert(span === Span(106751.99116730063, Days))
assert(span.toString === "Span(106751.99116730063, Days)")
assert(span.prettyString === "106751.99116730063 days")