Hello! I'm working on the Armstrong Numbers exercise in Gleam. I've got a solution that produces some unexpected results from the test runner: for two of the tests, get the result:
test: the_largest_and_last_armstrong_number_test
error: Pattern match failed
site: armstrong_numbers_test:52
value: False```
I'm not sure what pattern match it's talking about. I'm not using pattern matching in my solution, and the test doesn't seem to be using it either. This error shows up both in the online editor and when trying it locally. When I try my solution by manually running it with values from the test input, it works fine and gives the expected result.
Here's my solution:
pub fn is_armstrong_number(number: Int) -> Bool {
let assert Ok(digits) = int.digits(number, 10)
let num_digits = digits |> list.length |> int.to_float
digits
|> list.map(int.power(, num_digits))
|> list.map(result.unwrap(, 0.0))
|> list.map(float.round)
|> int.sum
== number
}
Any advice?