You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scalatest.dotty/src/main/scala/org/scalatest/AssertionsMacro.scala
+4-11Lines changed: 4 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -29,11 +29,8 @@ object AssertionsMacro {
29
29
* @paramcondition original condition expression
30
30
* @return transformed expression that performs the assertion check and throw <code>TestFailedException</code> with rich error message if assertion failed
* Provides implementation for <code>Assertions.assume(booleanExpr: Boolean)</code>, with rich error message.
@@ -42,12 +39,8 @@ object AssertionsMacro {
42
39
* @paramcondition original condition expression
43
40
* @return transformed expression that performs the assumption check and throw <code>TestCanceledException</code> with rich error message if assumption failed
* <p>Trait <code>DiagrammedAssertions</code> was inspired by Peter Niederwieser's work in <a href="http://code.google.com/p/spock/">Spock</a> and <a href="https://github.com/pniederw/expecty">Expecty</a>.
156
156
*/
157
-
traitDiagramsextendsAssertions
157
+
traitDiagramsextendsAssertions {
158
+
159
+
importscala.tasty._
160
+
importscala.quoted._
161
+
162
+
/**
163
+
* Assert that a boolean condition is true.
164
+
* If the condition is <code>true</code>, this method returns normally.
165
+
* Else, it throws <code>TestFailedException</code>.
166
+
*
167
+
* <p>
168
+
* This method is implemented in terms of a Scala macro that will generate a more helpful error message that includes
169
+
* a diagram showing expression values.
170
+
* </p>
171
+
*
172
+
* <p>
173
+
* If multi-line <code>Boolean</code> is passed in, it will fallback to the macro implementation of <code>Assertions</code>
174
+
* that does not contain diagram.
175
+
* </p>
176
+
*
177
+
* @paramcondition the boolean condition to assert
178
+
* @throwsTestFailedException if the condition is <code>false</code>.
0 commit comments