|
|
|
@ -234,3 +234,9 @@ test "get last digit" { |
|
|
|
|
try std.testing.expectEqual(@as(?u8, 7), get_last_digit("sevene")); |
|
|
|
|
try std.testing.expectEqual(@as(?u8, 0), get_last_digit("!evene")); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
test "get value" { |
|
|
|
|
// Oopsie! Thankfully the author of the puzzle didn't see this coming 🤪 |
|
|
|
|
try std.testing.expectEqual(@as(?u8, 21), get_value("twone")); |
|
|
|
|
try std.testing.expectEqual(@as(?u8, 58), get_value("fiveight")); |
|
|
|
|
} |
|
|
|
|