Changed brackets in custom 'capture' implementation
Because otherwise the automatic example checking system thinks that this example fails
This commit is contained in:
parent
1831266105
commit
52a11e8004
|
@ -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"
|
||||
}
|
Loading…
Reference in New Issue