From 31609f57e628a2d622e75cbc46104f1ead45f31b Mon Sep 17 00:00:00 2001 From: Mark Harrah Date: Tue, 26 Jan 2010 09:38:28 -0500 Subject: [PATCH] test to check proper tracking of generated classes --- .../compactify/project/build.properties | 2 + .../project/build/CompactifyTest.scala | 7 +++ .../compactify/src/main/scala/For.scala | 44 +++++++++++++++++++ .../compactify/src/main/scala/Nested.scala | 41 +++++++++++++++++ .../source-dependencies/compactify/test | 6 +++ 5 files changed, 100 insertions(+) create mode 100644 src/sbt-test/source-dependencies/compactify/project/build.properties create mode 100644 src/sbt-test/source-dependencies/compactify/project/build/CompactifyTest.scala create mode 100644 src/sbt-test/source-dependencies/compactify/src/main/scala/For.scala create mode 100644 src/sbt-test/source-dependencies/compactify/src/main/scala/Nested.scala create mode 100644 src/sbt-test/source-dependencies/compactify/test diff --git a/src/sbt-test/source-dependencies/compactify/project/build.properties b/src/sbt-test/source-dependencies/compactify/project/build.properties new file mode 100644 index 000000000..be8323d58 --- /dev/null +++ b/src/sbt-test/source-dependencies/compactify/project/build.properties @@ -0,0 +1,2 @@ +project.name=Compactify Test +project.version=1.0 \ No newline at end of file diff --git a/src/sbt-test/source-dependencies/compactify/project/build/CompactifyTest.scala b/src/sbt-test/source-dependencies/compactify/project/build/CompactifyTest.scala new file mode 100644 index 000000000..7403dfd1d --- /dev/null +++ b/src/sbt-test/source-dependencies/compactify/project/build/CompactifyTest.scala @@ -0,0 +1,7 @@ +import sbt._ + +class CompactifyTest(info: ProjectInfo) extends DefaultProject(info) +{ + def classes = (outputPath ** "*.class").get + lazy val outputEmpty = task { if(classes.isEmpty) None else Some("Classes existed:\n\t" + classes.mkString("\n\t")) } +} \ No newline at end of file diff --git a/src/sbt-test/source-dependencies/compactify/src/main/scala/For.scala b/src/sbt-test/source-dependencies/compactify/src/main/scala/For.scala new file mode 100644 index 000000000..5d1b8c4db --- /dev/null +++ b/src/sbt-test/source-dependencies/compactify/src/main/scala/For.scala @@ -0,0 +1,44 @@ +package somereallylongpackagenamethatwilltestsbtsanalyzer_somereallylongpackagenamethatwilltestsbtsanalyzer.somereallylongpackagenamethatwilltestsbtsanalyzer + +object T +{ + val y = List(3) + for(a <- y; + b <- y; + c <- y; + d <- y; + e <- y; + f <- y; + g <- y; + h <- y; + i <- y; + j <- y; + k <- y; + l <- y; + m <- y; + n <- y; + o <- y; + p <- y; + q <- y; + r <- y; + s <- y; + t <- y; + u <- y; + v <- y; + w <- y; + x <- y; + yx <- y; + z <- y; + aa <- y; + bb <- y; + cc <- y; + dd <- y; + ee <- y; + ff <- y; + gg <- y; + hh<- y; + ii <- y; + jj <- y; + kk <- y + ) yield a + b + c + d + e +} \ No newline at end of file diff --git a/src/sbt-test/source-dependencies/compactify/src/main/scala/Nested.scala b/src/sbt-test/source-dependencies/compactify/src/main/scala/Nested.scala new file mode 100644 index 000000000..798868d72 --- /dev/null +++ b/src/sbt-test/source-dependencies/compactify/src/main/scala/Nested.scala @@ -0,0 +1,41 @@ +package test + +object TopLevelModule1 +{ + object InnerModule1 + { + object InnerModule2 + { + trait Z { def q = 3 } + def x = 3 + } + } + class InnerClass1 + { + class InnerClass2 + { + val z = new TopLevelModule1.InnerClass2 + } + object InnerModule3 + { + val y = new TopLevel1 with InnerModule1.InnerModule2.Z { val x = 4 } + } + } + class InnerClass2 +} +class TopLevel1 +{ + object Inner1_1 +} +object TopLevel1 +{ + class Inner1_2 + object Inner1_2 +} + +object TopLevel2 +class TopLevel2 + +object TopLevel3 + +class TopLevel4 \ No newline at end of file diff --git a/src/sbt-test/source-dependencies/compactify/test b/src/sbt-test/source-dependencies/compactify/test new file mode 100644 index 000000000..3ca1fb2cd --- /dev/null +++ b/src/sbt-test/source-dependencies/compactify/test @@ -0,0 +1,6 @@ +> output-empty +> compile +-> output-empty +$ delete src/main/scala/For.scala src/main/scala/Nested.scala +> compile +> output-empty \ No newline at end of file