Skip to content

Commit 0c1baed

Browse files
committed
Use implicit Location, prepare for munit upgrade
1 parent 8a78310 commit 0c1baed

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

munit-scalacheck/shared/src/main/scala/munit/ScalaCheckSuite.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ trait ScalaCheckSuite extends FunSuite {
8888
case f: FailExceptionLike[_] =>
8989
// Promote FailException (i.e failed assertions) to property failures
9090
val r = result.copy(status = Failed(status.args, status.labels))
91-
Failure(f.withMessage(e.getMessage() + "\n\n" + renderResult(r)))
91+
Failure(f.withMessage(e.getMessage + "\n\n" + renderResult(r)))
9292
case _ =>
9393
Failure(
9494
new FailException(
@@ -101,7 +101,8 @@ trait ScalaCheckSuite extends FunSuite {
101101
}
102102
case _ =>
103103
// Fail using the test location
104-
Try(fail("\n" + renderResult(result))(test.location))
104+
implicit val loc = test.location
105+
Try(fail("\n" + renderResult(result)))
105106
}
106107
}
107108

tests/shared/src/main/scala/munit/BaseFrameworkSuite.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ abstract class BaseFrameworkSuite extends BaseSuite {
3030
}
3131

3232
def check(t: FrameworkTest): Unit = {
33+
implicit val loc = t.location
3334
test(t.cls.getSimpleName().withTags(t.tags)) {
3435
val baos = new ByteArrayOutputStream()
3536
val out = new PrintStream(baos)
@@ -109,8 +110,8 @@ abstract class BaseFrameworkSuite extends BaseSuite {
109110
obtained,
110111
t.expected,
111112
stdout
112-
)(t.location)
113+
)
113114
}
114-
}(t.location)
115+
}
115116
}
116117
}

0 commit comments

Comments
 (0)