Skip to content

Commit

Permalink
add failing tests for wartremover#288
Browse files Browse the repository at this point in the history
  • Loading branch information
Herr Ritschwumm committed Dec 21, 2016
1 parent 04d416c commit 7710c65
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions core/src/test/scala/wartremover/warts/StringPlusAnyTest.scala
Expand Up @@ -58,6 +58,20 @@ class StringPlusAnyTest extends FunSuite with ResultAssertions {
}
assertEmpty(result)
}

test("inserting into a Set is allowed.") {
val result = WartTestTraverser(StringPlusAny) {
Set("") + ""
}
assertEmpty(result)
}

test("concatenating strings with a block containing an if-statement.") {
val result = WartTestTraverser(StringPlusAny) {
"" + { val x = ""; if (true) x else x }
}
assertEmpty(result)
}

test("StringPlusAny wart obeys SuppressWarnings") {
val result = WartTestTraverser(StringPlusAny) {
Expand Down

0 comments on commit 7710c65

Please sign in to comment.