Skip to content

Commit

Permalink
Refactor test directories
Browse files Browse the repository at this point in the history
  • Loading branch information
zeptometer committed Aug 18, 2023
1 parent 47cfd1e commit 61f4b7f
Show file tree
Hide file tree
Showing 21 changed files with 59 additions and 57 deletions.
3 changes: 0 additions & 3 deletions compiler/test/dotty/tools/dotc/CompilationTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ class CompilationTests {
compileFilesInDir("tests/pos-custom-args/captures", defaultOptions.and("-language:experimental.captureChecking")),
compileFile("tests/pos-special/utf8encoded.scala", defaultOptions.and("-encoding", "UTF8")),
compileFile("tests/pos-special/utf16encoded.scala", defaultOptions.and("-encoding", "UTF16")),
compileFilesInDir("tests/pos-custom-args/quoted-pattern-poly", defaultOptions.and("-language:experimental.quotedPatternsWithPolymorphicFunctions")),
// Run tests for legacy lazy vals
compileFilesInDir("tests/pos", defaultOptions.and("-Ysafe-init", "-Ylegacy-lazy-vals", "-Ycheck-constraint-deps"), FileFilter.include(TestSources.posLazyValsAllowlist)),
compileDir("tests/pos-special/java-param-names", defaultOptions.withJavacOnlyOptions("-parameters")),
Expand Down Expand Up @@ -118,7 +117,6 @@ class CompilationTests {
compileFilesInDir("tests/neg", defaultOptions),
compileFilesInDir("tests/neg-deep-subtype", allowDeepSubtypes),
compileFilesInDir("tests/neg-custom-args/captures", defaultOptions.and("-language:experimental.captureChecking")),
compileFilesInDir("tests/neg-custom-args/quoted-pattern-poly", defaultOptions.and("-language:experimental.quotedPatternsWithPolymorphicFunctions")),
compileFile("tests/neg-custom-args/sourcepath/outer/nested/Test1.scala", defaultOptions.and("-sourcepath", "tests/neg-custom-args/sourcepath")),
compileDir("tests/neg-custom-args/sourcepath2/hi", defaultOptions.and("-sourcepath", "tests/neg-custom-args/sourcepath2", "-Xfatal-warnings")),
compileList("duplicate source", List(
Expand All @@ -139,7 +137,6 @@ class CompilationTests {
@Test def runAll: Unit = {
implicit val testGroup: TestGroup = TestGroup("runAll")
aggregateTests(
compileFilesInDir("tests/run-custom-args/quoted-pattern-poly", defaultOptions.and("-language:experimental.quotedPatternsWithPolymorphicFunctions")),
compileFilesInDir("tests/run", defaultOptions.and("-Ysafe-init")),
compileFilesInDir("tests/run-deep-subtype", allowDeepSubtypes),
compileFilesInDir("tests/run-custom-args/captures", allowDeepSubtypes.and("-language:experimental.captureChecking")),
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- Error: tests/neg-macros/quoted-pattern-with-bounded-type-params.scala:10:48 -----------------------------------------
10 | case '{ [A <: Int, B] => (x : A, y : A) => $b[A](x, y) : A } => // error
| ^
| Type must be fully defined.
| Consider annotating the splice using a type ascription:
| (${b}: XYZ).
-- [E006] Not Found Error: tests/neg-macros/quoted-pattern-with-bounded-type-params.scala:11:10 ------------------------
11 | '{ $b[String]("truthy", "falsy") } // error
| ^
| Not found: b
|
| longer explanation available when compiling with `-explain`
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/*
* Supporting hoas quote pattern with bounded type variable
* is future todo.
*/
/**
* Supporting hoas quote pattern with bounded type variable
* is future todo.
* Refer to: quoted-pattern-with-bounded-type-params.scala
*/

import scala.quoted.*

Expand Down
16 changes: 4 additions & 12 deletions tests/neg-macros/quoted-pattern-with-bounded-type-params.check
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
-- Error: tests/neg-macros/quoted-pattern-with-bounded-type-params.scala:10:48 -----------------------------------------
10 | case '{ [A <: Int, B] => (x : A, y : A) => $b[A](x, y) : A } => // error
| ^
| Type must be fully defined.
| Consider annotating the splice using a type ascription:
| (${b}: XYZ).
-- [E006] Not Found Error: tests/neg-macros/quoted-pattern-with-bounded-type-params.scala:11:10 ------------------------
11 | '{ $b[String]("truthy", "falsy") } // error
| ^
| Not found: b
|
| longer explanation available when compiling with `-explain`
-- Error: tests/neg-custom-args/quoted-pattern-poly/quoted-pattern-with-bounded-type-params.scala:10:50 ----------------
10 | case '{ [A <: Int, B] => (x : A, y : A) => $b[A](x, y) : A } => ??? // error
| ^
| Implementation restriction: Type arguments to Open pattern are expected to have no bounds
10 changes: 5 additions & 5 deletions tests/neg-macros/quoted-pattern-with-bounded-type-params.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Supporting hoas quote pattern with bounded type variable
* is future todo.
* Refer to: neg-custom-args/quoted-pattern-poly/quoted-pattern-with-bounded-type-params.scala
*/
/*
* Supporting hoas quote pattern with bounded type variable
* is future todo.
*/

import scala.quoted.*
import scala.language.experimental.quotedPatternsWithPolymorphicFunctions

def test(body: Expr[Any])(using Quotes): Expr[String] =
body match
Expand Down
16 changes: 16 additions & 0 deletions tests/neg-macros/quoted-pattern-with-type-params-regression.check
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
-- Error: tests/neg-macros/quoted-pattern-with-type-params.scala:8:31 --------------------------------------------------
8 | case '{ [A] => (x : A) => $b[A] : (A => A) } => ??? // error
| ^
| Type must be fully defined.
| Consider annotating the splice using a type ascription:
| (${b}: XYZ).
-- Error: tests/neg-macros/quoted-pattern-with-type-params.scala:9:33 --------------------------------------------------
9 | case '{ [A] => (x : A) => $b(x) : (A => A) } => ??? // error
| ^
| Type variables that this argument depends on are not captured in this hoas pattern
-- Error: tests/neg-macros/quoted-pattern-with-type-params.scala:10:24 -------------------------------------------------
10 | case '{ (a:Int) => $b[Int](a) : String } => ??? // error
| ^
| Type must be fully defined.
| Consider annotating the splice using a type ascription:
| (${b}: XYZ).
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* Refer to: quoted-pattern-with-type-params.scala
*/
import scala.quoted.*

def test(body: Expr[Any])(using Quotes): Expr[String] =
Expand Down
24 changes: 10 additions & 14 deletions tests/neg-macros/quoted-pattern-with-type-params.check
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
-- Error: tests/neg-macros/quoted-pattern-with-type-params.scala:8:31 --------------------------------------------------
8 | case '{ [A] => (x : A) => $b[A] : (A => A) } => ??? // error
| ^
| Type must be fully defined.
| Consider annotating the splice using a type ascription:
| (${b}: XYZ).
-- Error: tests/neg-macros/quoted-pattern-with-type-params.scala:9:33 --------------------------------------------------
9 | case '{ [A] => (x : A) => $b(x) : (A => A) } => ??? // error
-- Error: tests/neg-custom-args/quoted-pattern-poly/quoted-pattern-with-type-params.scala:5:32 -------------------------
5 | case '{ [A] => (x : A) => $b[A] : (A => A) } => ??? // error
| ^^^^^
| Implementation restriction: A higher-order pattern must carry value arguments
-- Error: tests/neg-custom-args/quoted-pattern-poly/quoted-pattern-with-type-params.scala:6:33 -------------------------
6 | case '{ [A] => (x : A) => $b(x) : (A => A) } => ??? // error
| ^
| Type variables that this argument depends on are not captured in this hoas pattern
-- Error: tests/neg-macros/quoted-pattern-with-type-params.scala:10:24 -------------------------------------------------
10 | case '{ (a:Int) => $b[Int](a) : String } => ??? // error
| ^
| Type must be fully defined.
| Consider annotating the splice using a type ascription:
| (${b}: XYZ).
-- Error: tests/neg-custom-args/quoted-pattern-poly/quoted-pattern-with-type-params.scala:7:26 -------------------------
7 | case '{ (a:Int) => $b[Int](a) : String } => ??? // error
| ^^^
| Type arguments of a hoas pattern needs to be defined inside the quoted pattern
4 changes: 1 addition & 3 deletions tests/neg-macros/quoted-pattern-with-type-params.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
/**
* Refer to: neg-custom-args/quoted-pattern-poly/quoted-pattern-with-type-params.scala
*/
import scala.quoted.*
import scala.language.experimental.quotedPatternsWithPolymorphicFunctions

def test(body: Expr[Any])(using Quotes): Expr[String] =
body match
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import scala.quoted.*
import scala.language.experimental.quotedPatternsWithPolymorphicFunctions

def test(body: Expr[Any])(using Quotes): Expr[String] =
body match
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import scala.quoted.*
import scala.language.experimental.quotedPatternsWithPolymorphicFunctions

inline def testExpr(inline body: Any) = ${ testExprImpl1('body) }
def testExprImpl1(body: Expr[Any])(using Quotes): Expr[String] =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import scala.quoted.*
import scala.language.experimental.quotedPatternsWithPolymorphicFunctions

inline def testExpr(inline body: Any) = ${ testExprImpl1('body) }
def testExprImpl1(body: Expr[Any])(using Quotes): Expr[String] =
Expand Down

0 comments on commit 61f4b7f

Please sign in to comment.