aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorIlya Kirillov <darthorimar@users.noreply.github.com>2017-03-18 15:42:33 +0300
committerIlya Kirillov <darthorimar@users.noreply.github.com>2017-03-19 02:56:28 +0300
commit923fd231e0b2c22c0c60379da91066c0f544e83c (patch)
tree1f80e94e0f605453c769bb4e62ecb3b5d8cc836c /test
parentb9c20082bcbd231eb67c3ded0d3fe6674c8c55b7 (diff)
downloadcbt-923fd231e0b2c22c0c60379da91066c0f544e83c.tar.gz
cbt-923fd231e0b2c22c0c60379da91066c0f544e83c.tar.bz2
cbt-923fd231e0b2c22c0c60379da91066c0f544e83c.zip
Add scalafix plugin with example project and tests
Diffstat (limited to 'test')
-rw-r--r--test/test.scala15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/test.scala b/test/test.scala
index c49d1e5..245b925 100644
--- a/test/test.scala
+++ b/test/test.scala
@@ -220,6 +220,7 @@ object Main{
compile("../plugins/scalatest")
compile("../plugins/wartremover")
compile("../plugins/uber-jar")
+ compile("../plugins/scalafix")
compile("../examples/scalafmt-example")
compile("../examples/scalariform-example")
compile("../examples/scalatest-example")
@@ -231,6 +232,7 @@ object Main{
}
compile("../examples/multi-standalone-example")
compile("../examples/multi-combined-example")
+ compile("../examples/scalafix-example")
if(sys.props("java.version").startsWith("1.7")){
System.err.println("\nskipping dotty tests on Java 7")
} else {
@@ -381,6 +383,19 @@ object Main{
assert(res.out.contains("via parent.parent: true 2"), res.out)
}
+ {
+ val sourceFile = cbtHome / "examples" / "scalafix-example" / "Main.scala"
+ val sourceBefore = sourceFile.readAsString
+ val res = runCbt("../examples/scalafix-example", Seq("compile"))
+ assert(res.exit0)
+ val sourceAfter = sourceFile.readAsString
+ assert(sourceAfter contains "@volatile")
+ assert(sourceAfter contains ": Unit")
+ assert(sourceAfter contains ": String ")
+ assert(sourceAfter contains "import scala.collection.immutable")
+ lib.write(sourceFile, sourceBefore)
+ }
+
System.err.println(" DONE!")
System.err.println( successes.toString ++ " succeeded, "++ failures.toString ++ " failed" )
if(failures > 0) System.exit(1) else System.exit(0)