From 6cf79aba08da5145b1a85466305a23928a031ba2 Mon Sep 17 00:00:00 2001 From: Grzegorz Kossakowski Date: Sun, 15 Dec 2013 23:51:46 +0100 Subject: [PATCH] Mark test that passes when name hashing is enabled. There's one test that starts to pass when we enable name hashing. It's `import-class` which tests whether tracking of dependencies that arise from imports is properly tracked. The name hashing algorithm uses different dependency tracking compared to the old algorithm and the new dependency extraction logic does handle import tree nodes properly so the test passes. We "mark" the test passing by copying it and enabling the name hashing flag in it. This is done similarly as in 940f7ff46d. --- .../source-dependencies/import-class-name-hashing/A.scala | 3 +++ .../source-dependencies/import-class-name-hashing/B.scala | 1 + .../import-class-name-hashing/build.sbt | 1 + .../import-class-name-hashing/changes/A.scala | 1 + .../source-dependencies/import-class-name-hashing/test | 8 ++++++++ 5 files changed, 14 insertions(+) create mode 100644 sbt/src/sbt-test/source-dependencies/import-class-name-hashing/A.scala create mode 100644 sbt/src/sbt-test/source-dependencies/import-class-name-hashing/B.scala create mode 100644 sbt/src/sbt-test/source-dependencies/import-class-name-hashing/build.sbt create mode 100644 sbt/src/sbt-test/source-dependencies/import-class-name-hashing/changes/A.scala create mode 100644 sbt/src/sbt-test/source-dependencies/import-class-name-hashing/test diff --git a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/A.scala b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/A.scala new file mode 100644 index 000000000..a93bbe535 --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/A.scala @@ -0,0 +1,3 @@ +package a + +class A diff --git a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/B.scala b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/B.scala new file mode 100644 index 000000000..0489f4a26 --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/B.scala @@ -0,0 +1 @@ +import a.A diff --git a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/build.sbt b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/build.sbt new file mode 100644 index 000000000..8a38ef414 --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/build.sbt @@ -0,0 +1 @@ +incOptions := incOptions.value.withNameHashing(true) diff --git a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/changes/A.scala b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/changes/A.scala new file mode 100644 index 000000000..2a93cdef5 --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/changes/A.scala @@ -0,0 +1 @@ +package a diff --git a/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/test b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/test new file mode 100644 index 000000000..7679ba52c --- /dev/null +++ b/sbt/src/sbt-test/source-dependencies/import-class-name-hashing/test @@ -0,0 +1,8 @@ +> compile + +# remove class a.A +$ copy-file changes/A.scala A.scala + +# 'import a.A' should now fail in B.scala +# succeeds because scalac doesn't track this dependency +-> compile