Skip to content

Commit

Permalink
Disable some SessionTests in Scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault committed Feb 15, 2021
1 parent 54f8877 commit f6d58ed
Showing 1 changed file with 35 additions and 3 deletions.
38 changes: 35 additions & 3 deletions shell/src/test/scala/ammonite/shell/SessionTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ object SessionTests extends TestSuite{
""")
}

test("cdIntoDirSymlink"){
def cdIntoDirSymlinkTest() = {
check.session(
s"""
@ import ammonite.ops._
Expand Down Expand Up @@ -85,8 +85,21 @@ object SessionTests extends TestSuite{
@ rm! tmpdir
""")
}
test("cdIntoDirSymlink"){
// Getting weird errors in Scala 3:
// java.lang.AssertionError: assertion failed: os.BasePathImpl & os.FilePath /
// TypeRef(ThisType(TypeRef(NoPrefix,module class os)),trait BasePathImpl) &
// HKTypeLambda(List(CC), List(TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class
// scala)),class Nothing),HKTypeLambda(List(_), List(TypeBounds(TypeRef(ThisType(TypeRef(
// NoPrefix,module class scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module
// class scala)),class Any))), TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class
// Any), List()))), AppliedType(TypeRef(ThisType(TypeRef(NoPrefix,module class os)),trait
// FilePath),List(TypeParamRef(CC))))
if (scala2) cdIntoDirSymlinkTest()
else "Disabled in Scala 3"
}

test("nestedSymlinks"){
def nestedSymlinksTest() = {
check.session(
s"""
@ import ammonite.ops._
Expand Down Expand Up @@ -132,7 +145,21 @@ object SessionTests extends TestSuite{
@ rm! tmpdir
""")
}
test("opsInSymlinkedDir"){
test("nestedSymlinks"){
// Disabled in Scala 3, it seems the Path -> FilePath conversion in the `ln.s` calls
// triggers an assertion in dotty:
// java.lang.AssertionError: assertion failed: os.BasePathImpl & os.FilePath / TypeRef(
// ThisType(TypeRef(NoPrefix,module class os)),trait BasePathImpl) & HKTypeLambda(List(CC),
// List(TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Nothing),
// HKTypeLambda(List(_), List(TypeBounds(TypeRef(ThisType(TypeRef(NoPrefix,module class
// scala)),class Nothing),TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Any
// ))), TypeRef(ThisType(TypeRef(NoPrefix,module class scala)),class Any), List()))),
// AppliedType(TypeRef(ThisType(TypeRef(NoPrefix,module class os)),trait FilePath),List(
// TypeParamRef(CC))))
if (scala2) nestedSymlinksTest()
else "Disabled in Scala 3"
}
def opsInSymlinkedDir() = {
// test mkdir, write, read, stat/stat.full, cp, and ls inside a symlinked directory
// (both while wd = symlinked and outside)
check.session(
Expand Down Expand Up @@ -226,6 +253,11 @@ object SessionTests extends TestSuite{
@ rm! tmpdir
""")
}
test("opsInSymlinkedDir"){
// Just like nestedSymlinks, getting some weird error in Scala 3
if (scala2) opsInSymlinkedDir()
else "Disabled in Scala 3"
}

}
}

0 comments on commit f6d58ed

Please sign in to comment.