Skip to content

Commit

Permalink
Merged branch idea243.release into idea243.x
Browse files Browse the repository at this point in the history
  • Loading branch information
builduser committed Nov 20, 2024
2 parents 7e7128c + 1ac37f7 commit 0ab007a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ private object CompilerMessages {
case bspMessageTemplate(_, position) => position
case line => line
}
trimmedMessage.stripSuffix(suffix).trim
val noSuffix = trimmedMessage.stripSuffix(suffix).trim
if (noSuffix.isBlank) trimmedMessage else noSuffix
}

def isUnusedImport(description: String): Boolean =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,27 @@ class CompilerMessagesTest {
val actual = CompilerMessages.description(originalMessage)
assertEquals(expected, actual)
}

@Test
def deprecationWarningsMessage(): Unit = {
val originalMessage = "there were 4 deprecation warnings; re-run with -deprecation for details\n\n"
val expected = "there were 4 deprecation warnings; re-run with -deprecation for details"
val actual = CompilerMessages.description(originalMessage)
assertEquals(expected, actual)
}

@Test
def oneLineMessage(): Unit = {
val originalMessage = "This is a one line error message"
val actual = CompilerMessages.description(originalMessage)
assertEquals(originalMessage, actual)
}

@Test
def blankAfterProcessing(): Unit = {
val originalMessage = "\n\nSome message \n "
val expected = "Some message"
val actual = CompilerMessages.description(originalMessage)
assertEquals(expected, actual)
}
}

0 comments on commit 0ab007a

Please sign in to comment.