From dbb6243a2bd17d8de5edba8d6e5e0a083dd9e7c1 Mon Sep 17 00:00:00 2001 From: Lucas Date: Mon, 29 May 2023 13:28:23 +0200 Subject: [PATCH] Correct the path of Correction of the path of exceptions thrown in certain comments to correct the DRI problem for scaladoc.throwed exceptions in some comments to correct the DRI problem for scaladoc --- .../main/scala/org/scalatest/Assertions.scala | 36 +++++++++---------- .../src/main/scala/org/scalatest/Suite.scala | 10 +++--- .../scalatest/wordspec/AnyWordSpecLike.scala | 8 ++--- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/dotty/core/src/main/scala/org/scalatest/Assertions.scala b/dotty/core/src/main/scala/org/scalatest/Assertions.scala index e5b1ffb2a9..6e4e5afc8d 100644 --- a/dotty/core/src/main/scala/org/scalatest/Assertions.scala +++ b/dotty/core/src/main/scala/org/scalatest/Assertions.scala @@ -467,7 +467,7 @@ trait Assertions extends TripleEquals { *

* * @param condition the boolean condition to assert - * @throws TestFailedException if the condition is false. + * @throws org.scalatest.exceptions.TestFailedException if the condition is false. */ inline def assert(inline condition: Boolean)(implicit prettifier: Prettifier, pos: source.Position, use: UseDefaultAssertions.type): Assertion = ${ AssertionsMacro.assert('{condition}, '{prettifier}, '{pos}, '{""}) } @@ -525,8 +525,8 @@ trait Assertions extends TripleEquals { * * @param condition the boolean condition to assert * @param clue An objects whose toString method returns a message to include in a failure report. - * @throws TestFailedException if the condition is false. - * @throws NullArgumentException if message is null. + * @throws org.scalatest.exceptions.TestFailedException if the condition is false. + * @throws org.scalactic.exceptions.NullArgumentException if message is null. */ inline def assert(inline condition: Boolean, clue: Any)(implicit prettifier: Prettifier, pos: source.Position, use: UseDefaultAssertions.type): Assertion = ${ AssertionsMacro.assert('{condition}, '{prettifier}, '{pos}, '{clue}) } @@ -574,7 +574,7 @@ trait Assertions extends TripleEquals { *

* * @param condition the boolean condition to assume - * @throws TestCanceledException if the condition is false. + * @throws org.scalatest.exceptions.TestCanceledException if the condition is false. */ inline def assume(inline condition: Boolean)(implicit prettifier: Prettifier, pos: source.Position, use: UseDefaultAssertions.type): Assertion = ${ AssertionsMacro.assume('{condition}, '{prettifier}, '{pos}, '{""}) } @@ -626,8 +626,8 @@ trait Assertions extends TripleEquals { * * @param condition the boolean condition to assume * @param clue An objects whose toString method returns a message to include in a failure report. - * @throws TestCanceledException if the condition is false. - * @throws NullArgumentException if message is null. + * @throws org.scalatest.exceptions.TestCanceledException if the condition is false. + * @throws org.scalactic.exceptions.NullArgumentException if message is null. */ inline def assume(inline condition: Boolean, clue: Any)(implicit prettifier: Prettifier, pos: source.Position, use: UseDefaultAssertions.type): Assertion = ${ AssertionsMacro.assume('{condition}, '{prettifier}, '{pos}, '{clue}) } @@ -751,7 +751,7 @@ trait Assertions extends TripleEquals { * @param classTag an implicit ClassTag 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 = @@ -812,7 +812,7 @@ trait Assertions extends TripleEquals { * @param classTag an implicit ClassTag representing the type of the specified * type parameter. * @return the Succeeded 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 = @@ -954,7 +954,7 @@ trait Assertions extends TripleEquals { * @param expected the expected value * @param clue An object whose toString method returns a message to include in a failure report. * @param actual the actual value, which should equal the passed expected value - * @throws TestFailedException if the passed actual value does not equal the passed expected value. + * @throws org.scalatest.exceptions.TestFailedException if the passed actual value does not equal the passed expected 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) }) } @@ -978,7 +978,7 @@ trait Assertions extends TripleEquals { * * @param expected the expected value * @param actual the actual value, which should equal the passed expected value - * @throws TestFailedException if the passed actual value does not equal the passed expected value. + * @throws org.scalatest.exceptions.TestFailedException if the passed actual value does not equal the passed expected 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) }) } @@ -1048,7 +1048,7 @@ trait Assertions extends TripleEquals { * message, to indicate a test failed. * * @param message A message describing the failure. - * @throws NullArgumentException if message is null + * @throws org.scalactic.exceptions.NullArgumentException if message is null */ inline def fail(message: String): Nothing = ${ source.Position.withPosition[Nothing]('{(pos: source.Position) => failImpl(message, pos) }) } @@ -1067,7 +1067,7 @@ trait Assertions extends TripleEquals { * * @param message A message describing the failure. * @param cause A Throwable that indicates the cause of the failure. - * @throws NullArgumentException if message or cause is null + * @throws org.scalactic.exceptions.NullArgumentException if message or cause is null */ inline def fail(message: String, cause: Throwable): Nothing = ${ source.Position.withPosition[Nothing]('{(pos: source.Position) => failImpl(message, cause, pos) }) } @@ -1086,7 +1086,7 @@ trait Assertions extends TripleEquals { * will return cause.toString. * * @param cause a Throwable that indicates the cause of the failure. - * @throws NullArgumentException if cause is null + * @throws org.scalactic.exceptions.NullArgumentException if cause is null */ inline def fail(cause: Throwable): Nothing = ${ source.Position.withPosition[Nothing]('{(pos: source.Position) => failImpl(cause: Throwable, pos: source.Position) }) } @@ -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 message is null + * @throws org.scalactic.exceptions.NullArgumentException if message is null */ inline def cancel(message: String): Nothing = ${ source.Position.withPosition[Nothing]('{(pos: source.Position) => cancelImpl(message, pos) }) } @@ -1129,7 +1129,7 @@ trait Assertions extends TripleEquals { * * @param message A message describing the failure. * @param cause A Throwable that indicates the cause of the failure. - * @throws NullArgumentException if message or cause is null + * @throws org.scalactic.exceptions.NullArgumentException if message or cause is null */ inline def cancel(message: String, cause: Throwable): Nothing = ${ source.Position.withPosition[Nothing]('{(pos: source.Position) => cancelImpl(message, cause, pos) }) } @@ -1148,7 +1148,7 @@ trait Assertions extends TripleEquals { * will return cause.toString. * * @param cause a Throwable that indicates the cause of the cancellation. - * @throws NullArgumentException if cause is null + * @throws org.scalactic.exceptions.NullArgumentException if cause is null */ inline def cancel(cause: Throwable): Nothing = ${ source.Position.withPosition[Nothing]('{(pos: source.Position) => cancelImpl(cause, pos) }) } @@ -1190,7 +1190,7 @@ trait Assertions extends TripleEquals { * (Employee's name was Bob Jones) Expected IllegalArgumentException to be thrown, but no exception was thrown * * - * @throws NullArgumentException if the passed clue is null + * @throws org.scalactic.exceptions.NullArgumentException if the passed clue is null */ def withClue[T](clue: Any)(fun: => T): T = { requireNonNull(clue) @@ -1296,7 +1296,7 @@ trait Assertions extends TripleEquals { *

* * @param f a block of code, which if it completes abruptly, should trigger a TestPendingException - * @throws TestPendingException if the passed block of code completes abruptly with an Exception or AssertionError + * @throws org.scalatest.exceptions.TestPendingException if the passed block of code completes abruptly with an Exception or AssertionError */ inline def pendingUntilFixed(f: => Unit): Assertion with PendingStatement = ${ source.Position.withPosition[Assertion with PendingStatement]('{(pos: source.Position) => pendingUntilFixedImpl(f, pos) }) } diff --git a/jvm/core/src/main/scala/org/scalatest/Suite.scala b/jvm/core/src/main/scala/org/scalatest/Suite.scala index 3adc2f8169..2132e780d2 100644 --- a/jvm/core/src/main/scala/org/scalatest/Suite.scala +++ b/jvm/core/src/main/scala/org/scalatest/Suite.scala @@ -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 configMap parameter is null. + * @throws org.scalactic.exceptions.NullArgumentException if the passed configMap parameter is null. * @throws IllegalArgumentException if testName is defined, but no test with the specified test name * exists in this Suite */ @@ -927,7 +927,7 @@ trait Suite extends Assertions with Serializable { thisSuite => * @param args the Args for this run * @return a Status object that indicates when the test started by this method has completed, and whether or not it failed . * - * @throws NullArgumentException if any of testName or args is null. + * @throws org.scalactic.exceptions.NullArgumentException if any of testName or args is null. * @throws IllegalArgumentException if testName is defined, but no test with the specified test name * exists in this Suite */ @@ -996,7 +996,7 @@ trait Suite extends Assertions with Serializable { thisSuite => * @param args the Args for this run * @return a Status 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 null. + * @throws org.scalactic.exceptions.NullArgumentException if any of the passed parameters is null. * @throws IllegalArgumentException if testName is defined, but no test with the specified test name * exists in this Suite */ @@ -1089,7 +1089,7 @@ trait Suite extends Assertions with Serializable { thisSuite => * @param args the Args for this run * @return a Status 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 null. + * @throws org.scalactic.exceptions.NullArgumentException if any passed parameter is null. * @throws IllegalArgumentException if testName is defined, but no test with the specified test name * exists in this Suite */ @@ -1151,7 +1151,7 @@ trait Suite extends Assertions with Serializable { thisSuite => * @param args the Args for this run * @return a Status 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 null. + * @throws org.scalactic.exceptions.NullArgumentException if any passed parameter is null. */ protected def runNestedSuites(args: Args): Status = { diff --git a/jvm/wordspec/src/main/scala/org/scalatest/wordspec/AnyWordSpecLike.scala b/jvm/wordspec/src/main/scala/org/scalatest/wordspec/AnyWordSpecLike.scala index 5743fc4b61..8268d8a12b 100644 --- a/jvm/wordspec/src/main/scala/org/scalatest/wordspec/AnyWordSpecLike.scala +++ b/jvm/wordspec/src/main/scala/org/scalatest/wordspec/AnyWordSpecLike.scala @@ -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 run has been invoked on this suite - * @throws NullArgumentException if specText or any passed test tag is null + * @throws org.scalactic.exceptions.NullArgumentException if specText or any passed test tag is null */ private def registerTestToRun(specText: String, testTags: List[Tag], methodName: String, testFun: () => Any /* Assertion */, pos: source.Position): Unit = { // SKIP-SCALATESTJS,NATIVE-START @@ -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 run has been invoked on this suite - * @throws NullArgumentException if specText or any passed test tag is null + * @throws org.scalactic.exceptions.NullArgumentException if specText or any passed test tag is null */ private def registerTestToIgnore(specText: String, testTags: List[Tag], methodName: String, testFun: () => Any /* Assertion */, pos: source.Position): Unit = { // SKIP-SCALATESTJS,NATIVE-START @@ -1226,7 +1226,7 @@ one error found * @param args the Args for this run * @return a Status object that indicates when the test started by this method has completed, and whether or not it failed . * - * @throws NullArgumentException if any of testName, reporter, stopper, or configMap + * @throws org.scalactic.exceptions.NullArgumentException if any of testName, reporter, stopper, or configMap * is null. */ protected override def runTest(testName: String, args: Args): Status = { @@ -1301,7 +1301,7 @@ one error found * @param args the Args for this run * @return a Status 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 null. + * @throws org.scalactic.exceptions.NullArgumentException if any of the passed parameters is null. * @throws IllegalArgumentException if testName is defined, but no test with the specified test name * exists in this Suite */