1
1
Fork 0

Changed brackets in custom 'capture' implementation

Because otherwise the automatic example checking system thinks that this example fails
This commit is contained in:
Svetlana Isakova 2020-10-21 15:52:50 +02:00
parent 1831266105
commit 52a11e8004
1 changed files with 2 additions and 2 deletions

View File

@ -6,7 +6,7 @@ fun capture(f: () -> Unit): CapturedException =
try { // [1]
f()
CapturedException(null, // [2]
"[Error]: Expected an exception")
"<Error>: Expected an exception")
} catch (e: Throwable) { // [3]
CapturedException(e::class,
if (e.message != null) ": ${e.message}"
@ -19,5 +19,5 @@ fun main() {
} eq "Exception: !!!"
capture {
1
} eq "[Error]: Expected an exception"
} eq "<Error>: Expected an exception"
}