Skip to content

Commit

Permalink
Merge branch 'dri-problem-scaladoc-throws' of https://github.com/Dede…
Browse files Browse the repository at this point in the history
  • Loading branch information
cheeseng committed Jun 15, 2023
2 parents 8de2201 + dbb6243 commit 5424083
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 27 deletions.
36 changes: 18 additions & 18 deletions dotty/core/src/main/scala/org/scalatest/Assertions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ trait Assertions extends TripleEquals {
* </p>
*
* @param condition the boolean condition to assert
* @throws TestFailedException if the condition is <code>false</code>.
* @throws org.scalatest.exceptions.TestFailedException if the condition is <code>false</code>.
*/
inline def assert(inline condition: Boolean)(implicit prettifier: Prettifier, pos: source.Position, use: UseDefaultAssertions.type): Assertion =
${ AssertionsMacro.assert('{condition}, '{prettifier}, '{pos}, '{""}) }
Expand Down Expand Up @@ -525,8 +525,8 @@ trait Assertions extends TripleEquals {
*
* @param condition the boolean condition to assert
* @param clue An objects whose <code>toString</code> method returns a message to include in a failure report.
* @throws TestFailedException if the condition is <code>false</code>.
* @throws NullArgumentException if <code>message</code> is <code>null</code>.
* @throws org.scalatest.exceptions.TestFailedException if the condition is <code>false</code>.
* @throws org.scalactic.exceptions.NullArgumentException if <code>message</code> is <code>null</code>.
*/
inline def assert(inline condition: Boolean, clue: Any)(implicit prettifier: Prettifier, pos: source.Position, use: UseDefaultAssertions.type): Assertion =
${ AssertionsMacro.assert('{condition}, '{prettifier}, '{pos}, '{clue}) }
Expand Down Expand Up @@ -574,7 +574,7 @@ trait Assertions extends TripleEquals {
* </p>
*
* @param condition the boolean condition to assume
* @throws TestCanceledException if the condition is <code>false</code>.
* @throws org.scalatest.exceptions.TestCanceledException if the condition is <code>false</code>.
*/
inline def assume(inline condition: Boolean)(implicit prettifier: Prettifier, pos: source.Position, use: UseDefaultAssertions.type): Assertion =
${ AssertionsMacro.assume('{condition}, '{prettifier}, '{pos}, '{""}) }
Expand Down Expand Up @@ -626,8 +626,8 @@ trait Assertions extends TripleEquals {
*
* @param condition the boolean condition to assume
* @param clue An objects whose <code>toString</code> method returns a message to include in a failure report.
* @throws TestCanceledException if the condition is <code>false</code>.
* @throws NullArgumentException if <code>message</code> is <code>null</code>.
* @throws org.scalatest.exceptions.TestCanceledException if the condition is <code>false</code>.
* @throws org.scalactic.exceptions.NullArgumentException if <code>message</code> is <code>null</code>.
*/
inline def assume(inline condition: Boolean, clue: Any)(implicit prettifier: Prettifier, pos: source.Position, use: UseDefaultAssertions.type): Assertion =
${ AssertionsMacro.assume('{condition}, '{prettifier}, '{pos}, '{clue}) }
Expand Down Expand Up @@ -751,7 +751,7 @@ trait Assertions extends TripleEquals {
* @param classTag an implicit <code>ClassTag</code> representing the type of the specified
* type parameter.
* @return the intercepted exception, if it is of the expected type
* @throws TestFailedException if the passed function does not complete abruptly with an exception
* @throws org.scalatest.exceptions.TestFailedException if the passed function does not complete abruptly with an exception
* that's an instance of the specified type.
*/
inline def intercept[T <: AnyRef](f: => Any)(implicit classTag: ClassTag[T]): T =
Expand Down Expand Up @@ -812,7 +812,7 @@ trait Assertions extends TripleEquals {
* @param classTag an implicit <code>ClassTag</code> representing the type of the specified
* type parameter.
* @return the <code>Succeeded</code> singleton, if an exception of the expected type is thrown
* @throws TestFailedException if the passed function does not complete abruptly with an exception
* @throws org.scalatest.exceptions.TestFailedException if the passed function does not complete abruptly with an exception
* that's an instance of the specified type.
*/
inline def assertThrows[T <: AnyRef](f: => Any)(implicit classTag: ClassTag[T]): Assertion =
Expand Down Expand Up @@ -954,7 +954,7 @@ trait Assertions extends TripleEquals {
* @param expected the expected value
* @param clue An object whose <code>toString</code> method returns a message to include in a failure report.
* @param actual the actual value, which should equal the passed <code>expected</code> value
* @throws TestFailedException if the passed <code>actual</code> value does not equal the passed <code>expected</code> value.
* @throws org.scalatest.exceptions.TestFailedException if the passed <code>actual</code> value does not equal the passed <code>expected</code> value.
*/
inline def assertResult[L, R](expected: L, clue: Any)(actual: R)(implicit prettifier: Prettifier, caneq: scala.CanEqual[L, R]): Assertion =
${ source.Position.withPosition[Assertion]('{(pos: source.Position) => assertResultImpl[L, R](expected, clue, actual, prettifier, pos, caneq) }) }
Expand All @@ -978,7 +978,7 @@ trait Assertions extends TripleEquals {
*
* @param expected the expected value
* @param actual the actual value, which should equal the passed <code>expected</code> value
* @throws TestFailedException if the passed <code>actual</code> value does not equal the passed <code>expected</code> value.
* @throws org.scalatest.exceptions.TestFailedException if the passed <code>actual</code> value does not equal the passed <code>expected</code> value.
*/
inline def assertResult[L, R](expected: L)(actual: R)(implicit prettifier: Prettifier, caneq: scala.CanEqual[L, R]): Assertion =
${ source.Position.withPosition[Assertion]('{(pos: source.Position) => assertResultImpl[L, R](expected, actual, prettifier, pos, caneq) }) }
Expand Down Expand Up @@ -1048,7 +1048,7 @@ trait Assertions extends TripleEquals {
* message, to indicate a test failed.
*
* @param message A message describing the failure.
* @throws NullArgumentException if <code>message</code> is <code>null</code>
* @throws org.scalactic.exceptions.NullArgumentException if <code>message</code> is <code>null</code>
*/
inline def fail(message: String): Nothing =
${ source.Position.withPosition[Nothing]('{(pos: source.Position) => failImpl(message, pos) }) }
Expand All @@ -1067,7 +1067,7 @@ trait Assertions extends TripleEquals {
*
* @param message A message describing the failure.
* @param cause A <code>Throwable</code> that indicates the cause of the failure.
* @throws NullArgumentException if <code>message</code> or <code>cause</code> is <code>null</code>
* @throws org.scalactic.exceptions.NullArgumentException if <code>message</code> or <code>cause</code> is <code>null</code>
*/
inline def fail(message: String, cause: Throwable): Nothing =
${ source.Position.withPosition[Nothing]('{(pos: source.Position) => failImpl(message, cause, pos) }) }
Expand All @@ -1086,7 +1086,7 @@ trait Assertions extends TripleEquals {
* will return <code>cause.toString</code>.
*
* @param cause a <code>Throwable</code> that indicates the cause of the failure.
* @throws NullArgumentException if <code>cause</code> is <code>null</code>
* @throws org.scalactic.exceptions.NullArgumentException if <code>cause</code> is <code>null</code>
*/
inline def fail(cause: Throwable): Nothing =
${ source.Position.withPosition[Nothing]('{(pos: source.Position) => failImpl(cause: Throwable, pos: source.Position) }) }
Expand All @@ -1110,7 +1110,7 @@ trait Assertions extends TripleEquals {
* message, to indicate a test was canceled.
*
* @param message A message describing the cancellation.
* @throws NullArgumentException if <code>message</code> is <code>null</code>
* @throws org.scalactic.exceptions.NullArgumentException if <code>message</code> is <code>null</code>
*/
inline def cancel(message: String): Nothing =
${ source.Position.withPosition[Nothing]('{(pos: source.Position) => cancelImpl(message, pos) }) }
Expand All @@ -1129,7 +1129,7 @@ trait Assertions extends TripleEquals {
*
* @param message A message describing the failure.
* @param cause A <code>Throwable</code> that indicates the cause of the failure.
* @throws NullArgumentException if <code>message</code> or <code>cause</code> is <code>null</code>
* @throws org.scalactic.exceptions.NullArgumentException if <code>message</code> or <code>cause</code> is <code>null</code>
*/
inline def cancel(message: String, cause: Throwable): Nothing =
${ source.Position.withPosition[Nothing]('{(pos: source.Position) => cancelImpl(message, cause, pos) }) }
Expand All @@ -1148,7 +1148,7 @@ trait Assertions extends TripleEquals {
* will return <code>cause.toString</code>.
*
* @param cause a <code>Throwable</code> that indicates the cause of the cancellation.
* @throws NullArgumentException if <code>cause</code> is <code>null</code>
* @throws org.scalactic.exceptions.NullArgumentException if <code>cause</code> is <code>null</code>
*/
inline def cancel(cause: Throwable): Nothing =
${ source.Position.withPosition[Nothing]('{(pos: source.Position) => cancelImpl(cause, pos) }) }
Expand Down Expand Up @@ -1190,7 +1190,7 @@ trait Assertions extends TripleEquals {
* (Employee's name was Bob Jones) Expected IllegalArgumentException to be thrown, but no exception was thrown
* </pre>
*
* @throws NullArgumentException if the passed <code>clue</code> is <code>null</code>
* @throws org.scalactic.exceptions.NullArgumentException if the passed <code>clue</code> is <code>null</code>
*/
def withClue[T](clue: Any)(fun: => T): T = {
requireNonNull(clue)
Expand Down Expand Up @@ -1296,7 +1296,7 @@ trait Assertions extends TripleEquals {
* </p>
*
* @param f a block of code, which if it completes abruptly, should trigger a <code>TestPendingException</code>
* @throws TestPendingException if the passed block of code completes abruptly with an <code>Exception</code> or <code>AssertionError</code>
* @throws org.scalatest.exceptions.TestPendingException if the passed block of code completes abruptly with an <code>Exception</code> or <code>AssertionError</code>
*/
inline def pendingUntilFixed(f: => Unit): Assertion with PendingStatement =
${ source.Position.withPosition[Assertion with PendingStatement]('{(pos: source.Position) => pendingUntilFixedImpl(f, pos) }) }
Expand Down
10 changes: 5 additions & 5 deletions jvm/core/src/main/scala/org/scalatest/Suite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ trait Suite extends Assertions with Serializable { thisSuite =>
* @param fullstacks a boolean that configures whether full stack traces should be printed for test failures
* @param stats a boolean that configures whether test and suite statistics are printed to the standard output
*
* @throws NullArgumentException if the passed <code>configMap</code> parameter is <code>null</code>.
* @throws org.scalactic.exceptions.NullArgumentException if the passed <code>configMap</code> parameter is <code>null</code>.
* @throws IllegalArgumentException if <code>testName</code> is defined, but no test with the specified test name
* exists in this <code>Suite</code>
*/
Expand Down Expand Up @@ -927,7 +927,7 @@ trait Suite extends Assertions with Serializable { thisSuite =>
* @param args the <code>Args</code> for this run
* @return a <code>Status</code> object that indicates when the test started by this method has completed, and whether or not it failed .
*
* @throws NullArgumentException if any of <code>testName</code> or <code>args</code> is <code>null</code>.
* @throws org.scalactic.exceptions.NullArgumentException if any of <code>testName</code> or <code>args</code> is <code>null</code>.
* @throws IllegalArgumentException if <code>testName</code> is defined, but no test with the specified test name
* exists in this <code>Suite</code>
*/
Expand Down Expand Up @@ -996,7 +996,7 @@ trait Suite extends Assertions with Serializable { thisSuite =>
* @param args the <code>Args</code> for this run
* @return a <code>Status</code> object that indicates when all tests started by this method have completed, and whether or not a failure occurred.
*
* @throws NullArgumentException if any of the passed parameters is <code>null</code>.
* @throws org.scalactic.exceptions.NullArgumentException if any of the passed parameters is <code>null</code>.
* @throws IllegalArgumentException if <code>testName</code> is defined, but no test with the specified test name
* exists in this <code>Suite</code>
*/
Expand Down Expand Up @@ -1089,7 +1089,7 @@ trait Suite extends Assertions with Serializable { thisSuite =>
* @param args the <code>Args</code> for this run
* @return a <code>Status</code> object that indicates when all tests and nested suites started by this method have completed, and whether or not a failure occurred.
*
* @throws NullArgumentException if any passed parameter is <code>null</code>.
* @throws org.scalactic.exceptions.NullArgumentException if any passed parameter is <code>null</code>.
* @throws IllegalArgumentException if <code>testName</code> is defined, but no test with the specified test name
* exists in this <code>Suite</code>
*/
Expand Down Expand Up @@ -1151,7 +1151,7 @@ trait Suite extends Assertions with Serializable { thisSuite =>
* @param args the <code>Args</code> for this run
* @return a <code>Status</code> object that indicates when all nested suites started by this method have completed, and whether or not a failure occurred.
*
* @throws NullArgumentException if any passed parameter is <code>null</code>.
* @throws org.scalactic.exceptions.NullArgumentException if any passed parameter is <code>null</code>.
*/
protected def runNestedSuites(args: Args): Status = {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ trait AnyWordSpecLike extends TestSuite with ShouldVerb with MustVerb with CanVe
* @param testFun the test function
* @throws DuplicateTestNameException if a test with the same name has been registered previously
* @throws TestRegistrationClosedException if invoked after <code>run</code> has been invoked on this suite
* @throws NullArgumentException if <code>specText</code> or any passed test tag is <code>null</code>
* @throws org.scalactic.exceptions.NullArgumentException if <code>specText</code> or any passed test tag is <code>null</code>
*/
private def registerTestToRun(specText: String, testTags: List[Tag], methodName: String, testFun: () => Any /* Assertion */, pos: source.Position): Unit = {
// SKIP-SCALATESTJS,NATIVE-START
Expand Down Expand Up @@ -168,7 +168,7 @@ trait AnyWordSpecLike extends TestSuite with ShouldVerb with MustVerb with CanVe
* @param testFun the test function
* @throws DuplicateTestNameException if a test with the same name has been registered previously
* @throws TestRegistrationClosedException if invoked after <code>run</code> has been invoked on this suite
* @throws NullArgumentException if <code>specText</code> or any passed test tag is <code>null</code>
* @throws org.scalactic.exceptions.NullArgumentException if <code>specText</code> or any passed test tag is <code>null</code>
*/
private def registerTestToIgnore(specText: String, testTags: List[Tag], methodName: String, testFun: () => Any /* Assertion */, pos: source.Position): Unit = {
// SKIP-SCALATESTJS,NATIVE-START
Expand Down Expand Up @@ -1226,7 +1226,7 @@ one error found
* @param args the <code>Args</code> for this run
* @return a <code>Status</code> object that indicates when the test started by this method has completed, and whether or not it failed .
*
* @throws NullArgumentException if any of <code>testName</code>, <code>reporter</code>, <code>stopper</code>, or <code>configMap</code>
* @throws org.scalactic.exceptions.NullArgumentException if any of <code>testName</code>, <code>reporter</code>, <code>stopper</code>, or <code>configMap</code>
* is <code>null</code>.
*/
protected override def runTest(testName: String, args: Args): Status = {
Expand Down Expand Up @@ -1301,7 +1301,7 @@ one error found
* @param args the <code>Args</code> for this run
* @return a <code>Status</code> object that indicates when all tests started by this method have completed, and whether or not a failure occurred.
*
* @throws NullArgumentException if any of the passed parameters is <code>null</code>.
* @throws org.scalactic.exceptions.NullArgumentException if any of the passed parameters is <code>null</code>.
* @throws IllegalArgumentException if <code>testName</code> is defined, but no test with the specified test name
* exists in this <code>Suite</code>
*/
Expand Down

0 comments on commit 5424083

Please sign in to comment.