Skip to content

Commit

Permalink
Add in compat for 2.13 tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ckipp01 committed Nov 29, 2020
1 parent 94d4018 commit dbb1f7e
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 8 deletions.
10 changes: 5 additions & 5 deletions tests/unit/src/test/scala/tests/imports/DependencySuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,16 @@ class DependencySuite extends BaseMarkdownSuite {
| not found: https://repo1.maven.org/maven2/org/scalameta/foobar/1.2.1/foobar-1.2.1.pom
|import $dep.`org.scalameta::mmunit:2.3.4`, $dep.`org.scalameta:foobar:1.2.1`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|error: dep-error.md:4:13: Error downloading org.scalameta:not-exists_2.13.2:2.3.4
|<redacted user.home>
| not found: https://repo1.maven.org/maven2/org/scalameta/not-exists_2.13.2/2.3.4/not-exists_2.13.2-2.3.4.pom
|import $dep.`org.scalameta:::not-exists:2.3.4`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|error: dep-error.md:3:13: Error downloading org.scalameta:mmunit_2.13:2.3.4
|<redacted user.home>
| not found: https://repo1.maven.org/maven2/org/scalameta/mmunit_2.13/2.3.4/mmunit_2.13-2.3.4.pom
|import $dep.`org.scalameta::mmunit:2.3.4`, $dep.`org.scalameta:foobar:1.2.1`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|error: dep-error.md:4:13: Error downloading org.scalameta:not-exists_2.13.4:2.3.4
|<redacted user.home>
| not found: https://repo1.maven.org/maven2/org/scalameta/not-exists_2.13.4/2.3.4/not-exists_2.13.4-2.3.4.pom
|import $dep.`org.scalameta:::not-exists:2.3.4`
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|""".stripMargin
)

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/test/scala/tests/markdown/AsyncSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class AsyncSuite extends BaseMarkdownSuite {
|java.util.concurrent.TimeoutException: Futures timed out after [10 milliseconds]
| at scala.concurrent.impl.Promise$DefaultPromise.ready(Promise.scala:259)
| at scala.concurrent.impl.Promise$DefaultPromise.result(Promise.scala:263)
| at scala.concurrent.Await$.$anonfun$result$1(package.scala:220)
| at scala.concurrent.Await$.$anonfun$result$1(package.scala:223)
| at scala.concurrent.BlockContext$DefaultBlockContext$.blockOn(BlockContext.scala:57)
| at scala.concurrent.Await$.result(package.scala:146)
| at repl.MdocSession$App.<init>(timeout.md:11)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ abstract class BaseMarkdownSuite extends tests.BaseSuite {
settings,
obtained => {
assertNoDiff(
Compat(obtained, Map.empty, postProcessObtained),
Compat(obtained, compat, postProcessObtained),
Compat(expected, compat, postProcessExpected)
)
}
Expand Down
23 changes: 23 additions & 0 deletions tests/unit/src/test/scala/tests/markdown/CrashSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,19 @@ class CrashSuite extends BaseMarkdownSuite {
|// at repl.MdocSession$App$$anonfun$3.apply(basic.md:14)
|// at repl.MdocSession$App$$anonfun$3.apply(basic.md:14)
|```
""".stripMargin,
compat = Map(
"2.13" ->
"""|```scala
|val x = 1
|???
|// scala.NotImplementedError: an implementation is missing
|// at scala.Predef$.$qmark$qmark$qmark(Predef.scala:347)
|// at repl.MdocSession$App$$anonfun$3.apply(basic.md:14)
|// at repl.MdocSession$App$$anonfun$3.apply(basic.md:14)
|```
""".stripMargin
)
)

checkError(
Expand Down Expand Up @@ -81,7 +93,18 @@ class CrashSuite extends BaseMarkdownSuite {
|// at repl.MdocSession$App$$anonfun$1.apply(relative.md:9)
|// at repl.MdocSession$App$$anonfun$1.apply(relative.md:9)
|```
""".stripMargin,
compat = Map(
"2.13" ->
"""|```scala
|???
|// scala.NotImplementedError: an implementation is missing
|// at scala.Predef$.$qmark$qmark$qmark(Predef.scala:347)
|// at repl.MdocSession$App$$anonfun$1.apply(relative.md:9)
|// at repl.MdocSession$App$$anonfun$1.apply(relative.md:9)
|```
""".stripMargin
)
)

check(
Expand Down
11 changes: 10 additions & 1 deletion tests/unit/src/test/scala/tests/markdown/ErrorSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,16 @@ class ErrorSuite extends BaseMarkdownSuite {
|^^^^^^^^^
|scala.NotImplementedError: an implementation is missing
| at scala.Predef$.$qmark$qmark$qmark(Predef.scala:288)
|""".stripMargin
|""".stripMargin,
compat = Map(
"2.13" ->
"""|error: crash.md:10:1: an implementation is missing
|x + y + z
|^^^^^^^^^
|scala.NotImplementedError: an implementation is missing
| at scala.Predef$.$qmark$qmark$qmark(Predef.scala:347)
|""".stripMargin
)
)

checkError(
Expand Down

0 comments on commit dbb1f7e

Please sign in to comment.