New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Style Traits + Matchers DSL Infix #2170
Changes from 6 commits
a816fa5
787ddf5
91192f2
ee66a2a
dcb74a4
10c89bc
3148641
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
} | ||
|
@@ -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) | ||
} | ||
|
@@ -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) | ||
} | ||
|
@@ -279,6 +282,7 @@ trait AsyncFreeSpecLike extends AsyncTestSuite with AsyncTestRegistration with I | |
* implementation of this method will register the text (passed to the contructor of <code>FreeSpecStringWrapper</code> | ||
* and immediately invoke the passed function. | ||
*/ | ||
//DOTTY-ONLY infix | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cheeseng Another infix that's not needed. |
||
def -(fun: => Unit): Unit = { | ||
|
||
try { | ||
|
@@ -310,6 +314,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) | ||
} | ||
|
@@ -330,6 +335,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) | ||
} | ||
|
@@ -350,6 +356,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) | ||
} | ||
|
@@ -370,6 +377,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) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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) | ||
} | ||
|
@@ -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) | ||
} | ||
|
@@ -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) | ||
} | ||
|
@@ -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) | ||
} | ||
|
@@ -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) | ||
} | ||
|
@@ -355,6 +360,7 @@ trait FixtureAnyFreeSpecLike extends org.scalatest.FixtureTestSuite with org.sca | |
* implementation of this method will register the text (passed to the contructor of <code>FreeSpecStringWrapper</code> | ||
* and immediately invoke the passed function. | ||
*/ | ||
//DOTTY-ONLY infix | ||
def -(fun: => Unit): Unit = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @cheeseng And another. I'll add a commit to remove these. |
||
|
||
// SKIP-SCALATESTJS,NATIVE-START | ||
|
@@ -393,6 +399,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) | ||
} | ||
|
@@ -415,6 +422,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) | ||
} | ||
|
@@ -437,6 +445,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) | ||
} | ||
|
@@ -459,6 +468,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) | ||
} | ||
|
@@ -481,6 +491,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) | ||
} | ||
|
@@ -504,6 +515,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) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@cheeseng This one is not needed, because - is symbolic.