summaryrefslogtreecommitdiff
path: root/core/test
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-02-02 08:53:11 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-02-02 08:54:16 -0800
commitf1153f8fff92be3711fd238cd2c7c06ac2a7a5bc (patch)
treea5cbc4d30abea88da2f774dcf210f8d5a5a2bb60 /core/test
parent5be2c5aea4527cf637948e6bf2e4c56e3273fbd9 (diff)
downloadmill-f1153f8fff92be3711fd238cd2c7c06ac2a7a5bc.tar.gz
mill-f1153f8fff92be3711fd238cd2c7c06ac2a7a5bc.tar.bz2
mill-f1153f8fff92be3711fd238cd2c7c06ac2a7a5bc.zip
Fix propagation of overriden `Module#basePath` and add a test to verify it's behavior
Diffstat (limited to 'core/test')
-rw-r--r--core/test/src/mill/define/BasePathTests.scala19
1 files changed, 18 insertions, 1 deletions
diff --git a/core/test/src/mill/define/BasePathTests.scala b/core/test/src/mill/define/BasePathTests.scala
index a0be4762..62f84787 100644
--- a/core/test/src/mill/define/BasePathTests.scala
+++ b/core/test/src/mill/define/BasePathTests.scala
@@ -1,8 +1,9 @@
package mill.define
-import mill.util.TestGraphs
+import mill.util.{TestGraphs, TestUtil}
import utest._
import ammonite.ops._
+import mill.{Module, T}
object BasePathTests extends TestSuite{
val testGraphs = new TestGraphs
val tests = Tests{
@@ -44,6 +45,22 @@ object BasePathTests extends TestSuite{
"cross", "210", "cross2", "js"
)
}
+ 'overriden - {
+ object overridenBasePath extends TestUtil.BaseModule {
+ override def basePath = pwd / 'overridenBasePathRootValue
+ object nested extends Module{
+ override def basePath = super.basePath / 'overridenBasePathNested
+ object nested extends Module{
+ override def basePath = super.basePath / 'overridenBasePathDoubleNested
+ }
+ }
+ }
+ assert(
+ overridenBasePath.basePath == pwd / 'overridenBasePathRootValue,
+ overridenBasePath.nested.basePath == pwd / 'overridenBasePathRootValue / 'nested / 'overridenBasePathNested,
+ overridenBasePath.nested.nested.basePath == pwd / 'overridenBasePathRootValue / 'nested / 'overridenBasePathNested / 'nested / 'overridenBasePathDoubleNested
+ )
+ }
}
}