Created
February 2, 2016 03:37
-
-
Save bvenners/6b52677e801683df8d0a to your computer and use it in GitHub Desktop.
ScalaTest Assertions and Diagrammed Assertions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scala> import org.scalatest.Assertions._ | |
import org.scalatest.Assertions._ | |
scala> val x = 1 | |
x: Int = 1 | |
scala> assert(List(1, 2, 3).contains(x) && x > 1) | |
org.scalatest.exceptions.TestFailedException: List(1, 2, 3) contained 1, but 1 was not greater than 1 | |
at org.scalatest.Assertions$class.newAssertionFailedException(Assertions.scala:541) | |
at org.scalatest.Assertions$.newAssertionFailedException(Assertions.scala:1414) | |
at org.scalatest.Assertions$AssertionsHelper.macroAssert(Assertions.scala:506) | |
... 43 elided | |
scala> import org.scalatest.DiagrammedAssertions._ | |
import org.scalatest.DiagrammedAssertions._ | |
scala> assert(List(1, 2, 3).contains(x) && x > 1) | |
org.scalatest.exceptions.TestFailedException: | |
assert(List(1, 2, 3).contains(x) && x > 1) | |
| | | | | | | | | | | |
| 1 2 3 true 1 | 1 | 1 | |
List(1, 2, 3) | false | |
false | |
at org.scalatest.Assertions$class.newAssertionFailedException(Assertions.scala:541) | |
at org.scalatest.DiagrammedAssertions$.newAssertionFailedException(DiagrammedAssertions.scala:390) | |
at org.scalatest.DiagrammedAssertions$DiagrammedAssertionsHelper.macroAssert(DiagrammedAssertions.scala:246) | |
... 43 elided | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment