Fix typo in Result#unwrap exception message

Fixes #8
This commit is contained in:
Michael Bull 2020-01-11 10:14:59 +00:00
parent 6651b18905
commit 434b8aa7fb
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,7 @@ fun <V, E> Result<V, E>.unwrap(): V {
return when (this) { return when (this) {
is Ok -> value is Ok -> value
is Err -> throw UnwrapException("called Result.wrap on an Err value $error") is Err -> throw UnwrapException("called Result.unwrap on an Err value $error")
} }
} }

View File

@ -16,7 +16,7 @@ class UnwrapTest {
@Test @Test
fun throwsExceptionIfErr() { fun throwsExceptionIfErr() {
assertFailsWith<UnwrapException>("called Result.wrap on an Err value 5000") { assertFailsWith<UnwrapException>("called Result.unwrap on an Err value 5000") {
@Suppress("IMPLICIT_NOTHING_AS_TYPE_PARAMETER") @Suppress("IMPLICIT_NOTHING_AS_TYPE_PARAMETER")
Err(5000).unwrap() Err(5000).unwrap()
} }