Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
proninyaroslav committed Jan 17, 2024
1 parent e61d95d commit 9c6f159
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ fun String.romanToArabic(): Int {
var arabicValue = 0
var lastValue = 0

if (isEmpty()) {
throw IllegalArgumentException("Invalid Roman numeral: \"\"")
}

uppercase().forEach { char ->
val value =
romanCharToValue[char] ?: throw IllegalArgumentException("Invalid Roman numeral: $char")
Expand Down

0 comments on commit 9c6f159

Please sign in to comment.