Skip to content

Commit

Permalink
Merge pull request #9048 from som-snytt/build/warnings
Browse files Browse the repository at this point in the history
Preferred parens in junit tests
  • Loading branch information
som-snytt committed Jun 10, 2020
2 parents 7000734 + 337a9b7 commit 1844d75
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/junit/scala/collection/ReusableBuildersTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ReusableBuildersTest {
val three = b.result()
b.clear()
b ++= (1 to 16).map(_.toFloat)
val sixteen = b.result
val sixteen = b.result()
b.clear()
b += 0f
val zero = b.result()
Expand Down
8 changes: 4 additions & 4 deletions test/junit/scala/collection/SortedSetMapEqualsTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class SortedSetMapEqualsTest {
b += 1
b += 2
b += 3
val m = b.result
val m = b.result()
val res = m.union(Set(4))
res
}
Expand All @@ -34,7 +34,7 @@ class SortedSetMapEqualsTest {
b += 2
b += 3
b += 4
val m = b.result
val m = b.result()
m
}
assertEquals(m1, m2)
Expand All @@ -51,7 +51,7 @@ class SortedSetMapEqualsTest {
b += (1 -> "")
b += (2 -> "")
b += (3 -> "")
val m = b.result
val m = b.result()
val res = m.concat(List(4 -> ""))
res
}
Expand All @@ -63,7 +63,7 @@ class SortedSetMapEqualsTest {
b += (2 -> "")
b += (3 -> "")
b += (4 -> "")
val m = b.result
val m = b.result()
m
}
assertEquals(m1, m2)
Expand Down
2 changes: 1 addition & 1 deletion test/junit/scala/collection/immutable/TreeMapTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class TreeMapTest extends AllocationTest {
@Test
def plusWithContains(): Unit = {
val data = Array.tabulate(1000)(i => s"${i}Key" -> s"${i}Value")
val tree = (TreeMap.newBuilder[String, String] ++= data).result
val tree = (TreeMap.newBuilder[String, String] ++= data).result()

data foreach {
case (k, v) =>
Expand Down
4 changes: 2 additions & 2 deletions test/junit/scala/collection/immutable/TreeSetTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ class TreeSetTest extends AllocationTest {
@Test
def plusWithContains(): Unit = {
val data = Array.tabulate(1000)(i => s"${i}Value")
val tree = (TreeSet.newBuilder[String] ++= data).result
val tree = (TreeSet.newBuilder[String] ++= data).result()

data foreach {
case (k) =>
Expand All @@ -191,7 +191,7 @@ class TreeSetTest extends AllocationTest {
@Test
def plusWithContainsFromMap(): Unit = {
val data = Array.tabulate(1000)(i => s"${i}Key" -> s"${i}Value")
val tree = (TreeMap.newBuilder[String, String] ++= data).result.keySet
val tree = (TreeMap.newBuilder[String, String] ++= data).result().keySet

data foreach {
case (k, v) =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ConsoleReporterTest {
def echoTest(): Unit = {
val reporter = createConsoleReporter("r", writerOut, echoWriterOut)
reporter.echo("Hello World!")
assertEquals("Hello World!", echoWriterOut.toString.linesIterator.next)
assertEquals("Hello World!", echoWriterOut.toString.linesIterator.next())

/** Check with constructor which has the same writer and echoWriter */
val reporter2 = createConsoleReporter("r", writerOut)
Expand Down Expand Up @@ -153,7 +153,7 @@ class ConsoleReporterTest {
val reporter2 = createConsoleReporter("w", writerOut2)
reporter2.displayPrompt()
val it2 = writerOut2.toString.linesIterator
assertTrue(it2.next.isEmpty)
assertTrue(it2.next().isEmpty)
assertEquals(output, it2.next())
assertFalse(it2.hasNext)

Expand Down

0 comments on commit 1844d75

Please sign in to comment.