Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ManualTests: re-use "ONLY" from HasTests #4207

Merged
merged 1 commit into from
Sep 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scalafmt-tests/src/test/scala/org/scalafmt/ManualTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ object ManualTests extends HasTests {
val testFiles = listFiles(testDir).map(x => (x, x.toString))
val manualFiles = for {
(path, filename) <- testFiles if filename.endsWith(manual)
test <- readFile(path).linesIterator.withFilter(_.startsWith("ONLY"))
.map { name =>
test <- readFile(path).linesIterator
.withFilter(_.startsWith(HasTests.onlyPrefix)).map { name =>
val testPath = stripPrefix(name)
val original = readFile(testPath)
val testFile = testPath.stripPrefix(testPrefix)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ object HasTests {

val unitTest40 = unitTest80.copy(maxColumn = 39)

private val onlyPrefix = "ONLY"
private val skipPrefix = "SKIP"
private[scalafmt] val onlyPrefix = "ONLY"
private[scalafmt] val skipPrefix = "SKIP"

private def isPrefix(name: String, prefix: String) = name
.startsWith(prefix) && !name.charAt(prefix.length).isLetterOrDigit
Expand Down
Loading