From 3e458ce8dde26e13db39f84b1ef50574eb04a9ee Mon Sep 17 00:00:00 2001
From: michelou main
method, for convenience.
*
assert
methods */
+ /** this class defines useful assert
methods */
trait Assert {
+ def enableStackTrace: Boolean = true
+
/** fails if expected != actual */
def assertEquals[A](msg: String, expected: A, actual: => A) {
if (expected != actual) fail(msg, expected, actual)
@@ -258,13 +267,13 @@ object SUnit {
/** throws AssertFailed
with given message msg
.
*/
def fail(msg: String) {
- throw new AssertFailed(msg)
+ throw AssertFailed(msg, enableStackTrace)
}
def fail[A](msg: String, expected: A, actual: => A) {
- throw new AssertFailed(msg +
- ", expected: " + expected +
- ", actual: " + actual)
+ throw AssertFailed(msg +
+ ", expected: " + expected +
+ ", actual: " + actual, enableStackTrace)
}
}
}
--
cgit v1.2.3