Skip to content

Commit

Permalink
Merge branch 'feature-style-traits-dsl-infix' of https://github.com/c…
Browse files Browse the repository at this point in the history
…heeseng/scalatest into 3.2.x-new
  • Loading branch information
cheeseng committed Nov 30, 2022
2 parents 4ce7f38 + 3148641 commit 3b2dc4e
Show file tree
Hide file tree
Showing 20 changed files with 803 additions and 656 deletions.
452 changes: 226 additions & 226 deletions dotty/matchers-core/src/main/scala/org/scalatest/matchers/Matcher.scala

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Expand Up @@ -213,6 +213,7 @@ trait AnyFreeSpecLike extends TestSuite with TestRegistration with Informing wit
* For more information and examples of this method's use, see the <a href="AnyFreeSpec.html">main documentation</a> for trait <code>AnyFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def in(testFun: => Any /* Assertion */): Unit = {
registerTestToRun(specText, tags, "in", () => testFun, pos)
}
Expand All @@ -233,6 +234,7 @@ trait AnyFreeSpecLike extends TestSuite with TestRegistration with Informing wit
* For more information and examples of this method's use, see the <a href="AnyFreeSpec.html">main documentation</a> for trait <code>AnyFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def is(testFun: => PendingStatement): Unit = {
registerTestToRun(specText, tags, "is", () => { testFun; succeed }, pos)
}
Expand All @@ -253,6 +255,7 @@ trait AnyFreeSpecLike extends TestSuite with TestRegistration with Informing wit
* For more information and examples of this method's use, see the <a href="AnyFreeSpec.html">main documentation</a> for trait <code>AnyFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def ignore(testFun: => Any /* Assertion */): Unit = {
registerTestToIgnore(specText, tags, "ignore", () => testFun, pos)
}
Expand Down Expand Up @@ -309,6 +312,7 @@ trait AnyFreeSpecLike extends TestSuite with TestRegistration with Informing wit
* For more information and examples of this method's use, see the <a href="AnyFreeSpec.html">main documentation</a> for trait <code>AnyFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def in(f: => Any /* Assertion */): Unit = {
registerTestToRun(string, List(), "in", () => f, pos)
}
Expand All @@ -329,6 +333,7 @@ trait AnyFreeSpecLike extends TestSuite with TestRegistration with Informing wit
* For more information and examples of this method's use, see the <a href="AnyFreeSpec.html">main documentation</a> for trait <code>AnyFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def ignore(f: => Any /* Assertion */): Unit = {
registerTestToIgnore(string, List(), "ignore", () => f, pos)
}
Expand All @@ -349,6 +354,7 @@ trait AnyFreeSpecLike extends TestSuite with TestRegistration with Informing wit
* For more information and examples of this method's use, see the <a href="AnyFreeSpec.html">main documentation</a> for trait <code>AnyFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def is(f: => PendingStatement): Unit = {
registerTestToRun(string, List(), "is", () => { f; succeed }, pos)
}
Expand All @@ -369,6 +375,7 @@ trait AnyFreeSpecLike extends TestSuite with TestRegistration with Informing wit
* For more information and examples of this method's use, see the <a href="AnyFreeSpec.html">main documentation</a> for trait <code>AnyFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def taggedAs(firstTestTag: Tag, otherTestTags: Tag*): ResultOfTaggedAsInvocationOnString = {
val tagList = firstTestTag :: otherTestTags.toList
new ResultOfTaggedAsInvocationOnString(string, tagList, pos)
Expand Down
Expand Up @@ -219,6 +219,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
* For more information and examples of this method's use, see the <a href="AsyncFreeSpec.html">main documentation</a> for trait <code>AsyncFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def in(testFun: => Future[compatible.Assertion]): Unit = {
registerTestToRun(specText, tags, () => testFun, pos)
}
Expand All @@ -239,6 +240,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
* For more information and examples of this method's use, see the <a href="AsyncFreeSpec.html">main documentation</a> for trait <code>AsyncFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def is(testFun: => PendingStatement): Unit = {
registerPendingTestToRun(specText, tags, () => testFun, pos)
}
Expand All @@ -259,6 +261,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
* For more information and examples of this method's use, see the <a href="AsyncFreeSpec.html">main documentation</a> for trait <code>AsyncFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def ignore(testFun: => Future[compatible.Assertion]): Unit = {
registerTestToIgnore(specText, tags, "ignore", () => testFun, pos)
}
Expand Down Expand Up @@ -310,6 +313,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
* For more information and examples of this method's use, see the <a href="AsyncFreeSpec.html">main documentation</a> for trait <code>AsyncFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def in(f: => Future[compatible.Assertion]): Unit = {
registerTestToRun(string, List(), () => f, pos)
}
Expand All @@ -330,6 +334,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
* For more information and examples of this method's use, see the <a href="AsyncFreeSpec.html">main documentation</a> for trait <code>AsyncFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def ignore(f: => Future[compatible.Assertion]): Unit = {
registerTestToIgnore(string, List(), "ignore", () => f, pos)
}
Expand All @@ -350,6 +355,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
* For more information and examples of this method's use, see the <a href="AsyncFreeSpec.html">main documentation</a> for trait <code>AsyncFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def is(f: => PendingStatement): Unit = {
registerPendingTestToRun(string, List(), () => f, pos)
}
Expand All @@ -370,6 +376,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I
* For more information and examples of this method's use, see the <a href="AsyncFreeSpec.html">main documentation</a> for trait <code>AsyncFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def taggedAs(firstTestTag: Tag, otherTestTags: Tag*): ResultOfTaggedAsInvocationOnString = {
val tagList = firstTestTag :: otherTestTags.toList
new ResultOfTaggedAsInvocationOnString(string, tagList, pos)
Expand Down
Expand Up @@ -237,6 +237,7 @@ trait FixtureAnyFreeSpecLike extends org.scalatest.FixtureTestSuite with org.sca
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def in(testFun: FixtureParam => Any /* Assertion */): Unit = {
registerTestToRun(specText, tags, "in", testFun, pos)
}
Expand All @@ -259,6 +260,7 @@ trait FixtureAnyFreeSpecLike extends org.scalatest.FixtureTestSuite with org.sca
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def in(testFun: () => Any /* Assertion */): Unit = {
registerTestToRun(specText, tags, "in", new NoArgTestWrapper(testFun), pos)
}
Expand All @@ -281,6 +283,7 @@ trait FixtureAnyFreeSpecLike extends org.scalatest.FixtureTestSuite with org.sca
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def is(testFun: => PendingStatement): Unit = {
registerPendingTestToRun(specText, tags, "is", unusedFixtureParam => testFun, pos)
}
Expand All @@ -303,6 +306,7 @@ trait FixtureAnyFreeSpecLike extends org.scalatest.FixtureTestSuite with org.sca
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def ignore(testFun: FixtureParam => Any /* Assertion */): Unit = {
registerTestToIgnore(specText, tags, "ignore", testFun, pos)
}
Expand All @@ -325,6 +329,7 @@ trait FixtureAnyFreeSpecLike extends org.scalatest.FixtureTestSuite with org.sca
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def ignore(testFun: () => Any /* Assertion */): Unit = {
registerTestToIgnore(specText, tags, "ignore", new NoArgTestWrapper(testFun), pos)
}
Expand Down Expand Up @@ -393,6 +398,7 @@ trait FixtureAnyFreeSpecLike extends org.scalatest.FixtureTestSuite with org.sca
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def in(testFun: FixtureParam => Any /* Assertion */): Unit = {
registerTestToRun(string, List(), "in", testFun, pos)
}
Expand All @@ -415,6 +421,7 @@ trait FixtureAnyFreeSpecLike extends org.scalatest.FixtureTestSuite with org.sca
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def in(testFun: () => Any /* Assertion */): Unit = {
registerTestToRun(string, List(), "in", new NoArgTestWrapper(testFun), pos)
}
Expand All @@ -437,6 +444,7 @@ trait FixtureAnyFreeSpecLike extends org.scalatest.FixtureTestSuite with org.sca
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def is(testFun: => PendingStatement): Unit = {
registerPendingTestToRun(string, List(), "is", unusedFixtureParam => testFun, pos)
}
Expand All @@ -459,6 +467,7 @@ trait FixtureAnyFreeSpecLike extends org.scalatest.FixtureTestSuite with org.sca
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def ignore(testFun: FixtureParam => Any /* Assertion */): Unit = {
registerTestToIgnore(string, List(), "ignore", testFun, pos)
}
Expand All @@ -481,6 +490,7 @@ trait FixtureAnyFreeSpecLike extends org.scalatest.FixtureTestSuite with org.sca
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def ignore(testFun: () => Any /* Assertion */): Unit = {
registerTestToIgnore(string, List(), "ignore", new NoArgTestWrapper(testFun), pos)
}
Expand All @@ -504,6 +514,7 @@ trait FixtureAnyFreeSpecLike extends org.scalatest.FixtureTestSuite with org.sca
* @param firstTestTag the first mandatory test tag
* @param otherTestTags the others additional test tags
*/
//DOTTY-ONLY infix
def taggedAs(firstTestTag: Tag, otherTestTags: Tag*): ResultOfTaggedAsInvocationOnString = {
val tagList = firstTestTag :: otherTestTags.toList
new ResultOfTaggedAsInvocationOnString(string, tagList, pos)
Expand Down
Expand Up @@ -216,6 +216,7 @@ trait FixtureAsyncFreeSpecLike extends org.scalatest.FixtureAsyncTestSuite with
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def in(testFun: FixtureParam => Future[compatible.Assertion]): Unit = {
registerAsyncTestToRun(specText, tags, "in", testFun, pos)
}
Expand All @@ -238,6 +239,7 @@ trait FixtureAsyncFreeSpecLike extends org.scalatest.FixtureAsyncTestSuite with
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def in(testFun: () => Future[compatible.Assertion]): Unit = {
registerAsyncTestToRun(specText, tags, "in", new NoArgTestWrapper(testFun), pos)
}
Expand All @@ -260,6 +262,7 @@ trait FixtureAsyncFreeSpecLike extends org.scalatest.FixtureAsyncTestSuite with
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def is(testFun: => PendingStatement): Unit = {
registerPendingTestToRun(specText, tags, "is", unusedFixtureParam => testFun, pos)
}
Expand All @@ -282,6 +285,7 @@ trait FixtureAsyncFreeSpecLike extends org.scalatest.FixtureAsyncTestSuite with
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def ignore(testFun: FixtureParam => Future[compatible.Assertion]): Unit = {
registerAsyncTestToIgnore(specText, tags, "ignore", testFun, pos)
}
Expand All @@ -304,6 +308,7 @@ trait FixtureAsyncFreeSpecLike extends org.scalatest.FixtureAsyncTestSuite with
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def ignore(testFun: () => Future[compatible.Assertion]): Unit = {
registerAsyncTestToIgnore(specText, tags, "ignore", new NoArgTestWrapper(testFun), pos)
}
Expand Down Expand Up @@ -366,6 +371,7 @@ trait FixtureAsyncFreeSpecLike extends org.scalatest.FixtureAsyncTestSuite with
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def in(testFun: FixtureParam => Future[compatible.Assertion]): Unit = {
registerAsyncTestToRun(string, List(), "in", testFun, pos)
}
Expand All @@ -388,6 +394,7 @@ trait FixtureAsyncFreeSpecLike extends org.scalatest.FixtureAsyncTestSuite with
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def in(testFun: () => Future[compatible.Assertion]): Unit = {
registerAsyncTestToRun(string, List(), "in", new NoArgTestWrapper(testFun), pos)
}
Expand All @@ -410,6 +417,7 @@ trait FixtureAsyncFreeSpecLike extends org.scalatest.FixtureAsyncTestSuite with
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def is(testFun: => PendingStatement): Unit = {
registerPendingTestToRun(string, List(), "is", unusedFixtureParam => testFun, pos)
}
Expand All @@ -432,6 +440,7 @@ trait FixtureAsyncFreeSpecLike extends org.scalatest.FixtureAsyncTestSuite with
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def ignore(testFun: FixtureParam => Future[compatible.Assertion]): Unit = {
registerAsyncTestToIgnore(string, List(), "ignore", testFun, pos)
}
Expand All @@ -454,6 +463,7 @@ trait FixtureAsyncFreeSpecLike extends org.scalatest.FixtureAsyncTestSuite with
*
* @param testFun the test function
*/
//DOTTY-ONLY infix
def ignore(testFun: () => Future[compatible.Assertion]): Unit = {
registerAsyncTestToIgnore(string, List(), "ignore", new NoArgTestWrapper(testFun), pos)
}
Expand All @@ -477,6 +487,7 @@ trait FixtureAsyncFreeSpecLike extends org.scalatest.FixtureAsyncTestSuite with
* @param firstTestTag the first mandatory test tag
* @param otherTestTags the others additional test tags
*/
//DOTTY-ONLY infix
def taggedAs(firstTestTag: Tag, otherTestTags: Tag*): ResultOfTaggedAsInvocationOnString = {
val tagList = firstTestTag :: otherTestTags.toList
new ResultOfTaggedAsInvocationOnString(string, tagList, pos)
Expand Down
Expand Up @@ -189,6 +189,7 @@ trait PathAnyFreeSpecLike extends org.scalatest.Suite with OneInstancePerTest wi
* trait <code>org.scalatest.path.FreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def in(testFun: => Unit /* Assertion */): Unit = {
registerTestToRun(specText, tags, "in", () => testFun, pos)
}
Expand Down Expand Up @@ -216,6 +217,7 @@ trait PathAnyFreeSpecLike extends org.scalatest.Suite with OneInstancePerTest wi
* trait <code>org.scalatest.freespec.PathAnyFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def is(testFun: => PendingStatement): Unit = {
registerTestToRun(specText, tags, "is", () => testFun, pos)
}
Expand All @@ -240,6 +242,7 @@ trait PathAnyFreeSpecLike extends org.scalatest.Suite with OneInstancePerTest wi
* be executed. Instead, a <code>TestIgnored</code> event will be fired.
* </p>
*/
//DOTTY-ONLY infix
def ignore(testFun: => Unit /* Assertion */): Unit = {
registerTestToIgnore(specText, tags, "ignore", () => testFun, pos)
}
Expand Down Expand Up @@ -303,6 +306,7 @@ trait PathAnyFreeSpecLike extends org.scalatest.Suite with OneInstancePerTest wi
* trait <code>org.scalatest.freespec.PathAnyFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def in(f: => Unit /* Assertion */): Unit = {
registerTestToRun(string, List(), "in", () => f, pos)
}
Expand All @@ -327,6 +331,7 @@ trait PathAnyFreeSpecLike extends org.scalatest.Suite with OneInstancePerTest wi
* be executed. Instead, a <code>TestIgnored</code> event will be fired.
* </p>
*/
//DOTTY-ONLY infix
def ignore(f: => Unit /* Assertion */): Unit = {
registerTestToIgnore(string, List(), "ignore", () => f, pos)
}
Expand Down Expand Up @@ -354,6 +359,7 @@ trait PathAnyFreeSpecLike extends org.scalatest.Suite with OneInstancePerTest wi
* trait <code>org.scalatest.freespec.PathAnyFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def is(f: => PendingStatement): Unit = {
registerTestToRun(string, List(), "is", () => f, pos)
}
Expand All @@ -376,6 +382,7 @@ trait PathAnyFreeSpecLike extends org.scalatest.Suite with OneInstancePerTest wi
* trait <code>org.scalatest.freespec.AnyFreeSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def taggedAs(firstTestTag: Tag, otherTestTags: Tag*): ResultOfTaggedAsInvocationOnString = {
val tagList = firstTestTag :: otherTestTags.toList
new ResultOfTaggedAsInvocationOnString(string, tagList, pos)
Expand Down
Expand Up @@ -218,6 +218,7 @@ trait AnyFunSpecLike extends TestSuite with TestRegistration with Informing with
* in the main documentation for trait <code>AnyFunSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def should(behaveWord: BehaveWord) = behaveWord

/**
Expand All @@ -237,6 +238,7 @@ trait AnyFunSpecLike extends TestSuite with TestRegistration with Informing with
* in the main documentation for trait <code>AnyFunSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def must(behaveWord: BehaveWord) = behaveWord
}

Expand Down Expand Up @@ -339,6 +341,7 @@ trait AnyFunSpecLike extends TestSuite with TestRegistration with Informing with
* in the main documentation for trait <code>AnyFunSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def should(behaveWord: BehaveWord) = behaveWord

/**
Expand All @@ -358,6 +361,7 @@ trait AnyFunSpecLike extends TestSuite with TestRegistration with Informing with
* in the main documentation for trait <code>AnyFunSpec</code>.
* </p>
*/
//DOTTY-ONLY infix
def must(behaveWord: BehaveWord) = behaveWord
}

Expand Down

0 comments on commit 3b2dc4e

Please sign in to comment.