From 8b8de1101ca6d5ad722c8851c4473990c2789894 Mon Sep 17 00:00:00 2001 From: Pierre DAL-PRA Date: Fri, 7 Aug 2015 00:23:14 +0200 Subject: [PATCH] Fix additional warnings --- cache/src/test/scala/CacheTest.scala | 4 +-- util/complete/src/test/scala/ParserTest.scala | 32 +++++++++---------- .../logic/src/test/scala/sbt/logic/Test.scala | 2 +- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cache/src/test/scala/CacheTest.scala b/cache/src/test/scala/CacheTest.scala index cbb7319b7..ca66ba925 100644 --- a/cache/src/test/scala/CacheTest.scala +++ b/cache/src/test/scala/CacheTest.scala @@ -12,7 +12,7 @@ object CacheTest // extends Properties("Cache test") import FileInfo.hash._ import Ordering._ import sbinary.DefaultProtocol.FileFormat - def test { + def test(): Unit = { lazy val create = new File("test") val length = cached(lengthCache) { @@ -28,4 +28,4 @@ object CacheTest // extends Properties("Cache test") } c(create :+: fileLength :+: HNil) } -} \ No newline at end of file +} diff --git a/util/complete/src/test/scala/ParserTest.scala b/util/complete/src/test/scala/ParserTest.scala index efe2f3493..f02431e53 100644 --- a/util/complete/src/test/scala/ParserTest.scala +++ b/util/complete/src/test/scala/ParserTest.scala @@ -44,7 +44,7 @@ object ParserTest extends Properties("Completing Parser") { val nested = (token("a1") ~ token("b2")) ~ "c3" val nestedDisplay = (token("a1", "") ~ token("b2", "")) ~ "c3" - val spacePort = (token(Space) ~> Port) + val spacePort = token(Space) ~> Port def p[T](f: T): T = { println(f); f } @@ -58,7 +58,7 @@ object ParserTest extends Properties("Completing Parser") { def checkAll(in: String, parser: Parser[_], expect: Completions): Prop = { val cs = completions(parser, in, 1) - ("completions: " + cs) |: ("Expected: " + expect) |: ((cs == expect): Prop) + ("completions: " + cs) |: ("Expected: " + expect) |: (cs == expect: Prop) } def checkInvalid(in: String) = @@ -68,31 +68,31 @@ object ParserTest extends Properties("Completing Parser") { def checkInv(in: String, parser: Parser[_]): Prop = { val cs = completions(parser, in, 1) - ("completions: " + cs) |: ((cs == Completions.nil): Prop) + ("completions: " + cs) |: (cs == Completions.nil: Prop) } - property("nested tokens a") = checkSingle("", Completion.tokenStrict("", "a1"))(Completion.displayStrict("")) - property("nested tokens a1") = checkSingle("a", Completion.tokenStrict("a", "1"))(Completion.displayStrict("")) + property("nested tokens a") = checkSingle("", Completion.token("", "a1"))(Completion.displayOnly("")) + property("nested tokens a1") = checkSingle("a", Completion.token("a", "1"))(Completion.displayOnly("")) property("nested tokens a inv") = checkInvalid("b") - property("nested tokens b") = checkSingle("a1", Completion.tokenStrict("", "b2"))(Completion.displayStrict("")) - property("nested tokens b2") = checkSingle("a1b", Completion.tokenStrict("b", "2"))(Completion.displayStrict("")) + property("nested tokens b") = checkSingle("a1", Completion.token("", "b2"))(Completion.displayOnly("")) + property("nested tokens b2") = checkSingle("a1b", Completion.token("b", "2"))(Completion.displayOnly("")) property("nested tokens b inv") = checkInvalid("a1a") - property("nested tokens c") = checkSingle("a1b2", Completion.suggestStrict("c3"))() - property("nested tokens c3") = checkSingle("a1b2c", Completion.suggestStrict("3"))() + property("nested tokens c") = checkSingle("a1b2", Completion.suggestion("c3"))() + property("nested tokens c3") = checkSingle("a1b2c", Completion.suggestion("3"))() property("nested tokens c inv") = checkInvalid("a1b2a") - property("suggest space") = checkOne("", spacePort, Completion.tokenStrict("", " ")) - property("suggest port") = checkOne(" ", spacePort, Completion.displayStrict("")) - property("no suggest at end") = checkOne("asdf", "asdf", Completion.suggestStrict("")) - property("no suggest at token end") = checkOne("asdf", token("asdf"), Completion.suggestStrict("")) - property("empty suggest for examples") = checkOne("asdf", any.+.examples("asdf", "qwer"), Completion.suggestStrict("")) - property("empty suggest for examples token") = checkOne("asdf", token(any.+.examples("asdf", "qwer")), Completion.suggestStrict("")) + property("suggest space") = checkOne("", spacePort, Completion.token("", " ")) + property("suggest port") = checkOne(" ", spacePort, Completion.displayOnly("")) + property("no suggest at end") = checkOne("asdf", "asdf", Completion.suggestion("")) + property("no suggest at token end") = checkOne("asdf", token("asdf"), Completion.suggestion("")) + property("empty suggest for examples") = checkOne("asdf", any.+.examples("asdf", "qwer"), Completion.suggestion("")) + property("empty suggest for examples token") = checkOne("asdf", token(any.+.examples("asdf", "qwer")), Completion.suggestion("")) val colors = Set("blue", "green", "red") val base = (seen: Seq[String]) => token(ID examples (colors -- seen)) val sep = token(Space) val repeat = repeatDep(base, sep) - def completionStrings(ss: Set[String]): Completions = Completions(ss.map { s => Completion.tokenStrict("", s) }) + def completionStrings(ss: Set[String]): Completions = Completions(ss.map { s => Completion.token("", s) }) property("repeatDep no suggestions for bad input") = checkInv(".", repeat) property("repeatDep suggest all") = checkAll("", repeat, completionStrings(colors)) diff --git a/util/logic/src/test/scala/sbt/logic/Test.scala b/util/logic/src/test/scala/sbt/logic/Test.scala index a5277582c..f62a9e767 100644 --- a/util/logic/src/test/scala/sbt/logic/Test.scala +++ b/util/logic/src/test/scala/sbt/logic/Test.scala @@ -104,7 +104,7 @@ object TestClauses { Logic.reduceAll(cs, Set(A, B)) } - def all { + def all(): Unit = { println(s"Cycles: $cycles") println(s"xNeg: $excludedNeg") println(s"xPos: $excludedPos")