Add definedTestNames test (#9210)

This commit is contained in:
kenji yoshida 2026-05-12 09:01:59 +09:00 committed by GitHub
parent 49f19feef1
commit 00bd61d411
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,8 @@
scalaVersion := "2.13.18"
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.19.0" % Test
InputKey[Unit]("checkDefinedTestNames") := {
val actual = (Test / definedTestNames).value
assert(actual == Seq("example.Test1"), actual)
}

View File

@ -0,0 +1,3 @@
package example
object Test1 extends org.scalacheck.Properties("Test1")

View File

@ -0,0 +1,7 @@
> checkDefinedTestNames
$ copy-file src/test/scala/Test1.scala tmp/Test1.scala
$ delete src
-> checkDefinedTestNames
$ copy-file tmp/Test1.scala src/test/scala/Test1.scala
$ exists src/test/scala/Test1.scala
> checkDefinedTestNames