diff options
author | Jan Christopher Vogt <oss.nsp@cvogt.org> | 2017-03-28 10:04:06 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-28 10:04:06 -0400 |
commit | 497fff26705be6a21e6099a562ff14bfe1d90003 (patch) | |
tree | 6d75c89f145fc6319ff88316bdcbf97ed6ca4beb /test | |
parent | c0e956df1e4c466f5c80282f1086b0589959ce2e (diff) | |
parent | 26021f5e462fb9a5633a5f565235a2829fb6132b (diff) | |
download | cbt-497fff26705be6a21e6099a562ff14bfe1d90003.tar.gz cbt-497fff26705be6a21e6099a562ff14bfe1d90003.tar.bz2 cbt-497fff26705be6a21e6099a562ff14bfe1d90003.zip |
Merge pull request #462 from cvogt/meta
scala meta and scalafix
Diffstat (limited to 'test')
-rw-r--r-- | test/test.scala | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/test/test.scala b/test/test.scala index 5c107fe..f3fb7c5 100644 --- a/test/test.scala +++ b/test/test.scala @@ -257,7 +257,7 @@ object Main{ compile("../plugins/scalatest") compile("../plugins/wartremover") compile("../plugins/uber-jar") - compile("../plugins/scalafix") + compile("../plugins/scalafix-compiler-plugin") compile("../examples/scalafmt-example") compile("../examples/scalariform-example") compile("../examples/scalatest-example") @@ -427,6 +427,35 @@ object Main{ } { + val res = runCbt("../examples/cross-rewrite-example", Seq("cross.exportedClasspath")) + assert(res.exit0) + Seq("cats","scalaz","2.11.8","2.12.1").foreach( + s => assert(res.out contains s, res.out) + ) + } + + { + val sourceFile = cbtHome / "examples" / "scalafix-compiler-plugin-example" / "Main.scala" + val sourceBefore = sourceFile.readAsString + runCbt("../examples/scalafix-compiler-plugin-example", Seq("clean","force")) + val res = runCbt("../examples/scalafix-compiler-plugin-example", Seq("compile")) + assert(res.exit0) + val sourceAfter = sourceFile.readAsString + assert(!(sourceBefore contains "@volatile")) + assert(!(sourceBefore contains ": Unit")) + assert(!(sourceBefore contains ": String ")) + assert(!(sourceBefore contains "import scala.collection.immutable")) + assert(sourceAfter contains "@volatile") + assert(sourceAfter contains ": Unit") + assert(sourceAfter contains ": String ") + assert(sourceAfter contains "import scala.collection.immutable") + lib.write(sourceFile, sourceBefore) + } + + /* + // currently fails with + // java.lang.UnsupportedOperationException: scalafix.rewrite.ScalafixMirror.fromMirror $anon#typeSignature requires the semantic api + { val sourceFile = cbtHome / "examples" / "scalafix-example" / "Main.scala" val sourceBefore = sourceFile.readAsString runCbt("../examples/scalafix-example", Seq("clean","force")) @@ -443,6 +472,7 @@ object Main{ assert(sourceAfter contains "import scala.collection.immutable") lib.write(sourceFile, sourceBefore) } + */ System.err.println(" DONE!") System.err.println( successes.toString ++ " succeeded, "++ failures.toString ++ " failed" ) |