My two-fer solution is straightforward:
import gleam/option.{type Option}
pub fn two_fer(name: Option(String)) -> String {
let id = option.unwrap(name, "you")
"One for " <> id <> ", one for me."
}
Testing locally fails with a very cryptic message:
$ gleam test
Compiled in 0.07s
Running two_fer_test.main
exception error: #{function => <<"read_module">>,line => 74,
message => <<"Assertion pattern match failed">>,
module => <<"exercism/test_runner">>,
value => {error,not_utf8},
gleam_error => let_assert}
in function exercism@test_runner:read_module/1 (/home/parallels/src/exercism/exercism.io/gleam/two-fer/build/dev/erlang/exercism_test_runner/_gleam_artefacts/exercism@test_runner.erl, line 96)
in call from gleam@list:do_map/3 (/home/parallels/src/exercism/exercism.io/gleam/two-fer/build/dev/erlang/gleam_stdlib/_gleam_artefacts/gleam@list.erl, line 119)
in call from exercism@test_runner:main/0 (/home/parallels/src/exercism/exercism.io/gleam/two-fer/build/dev/erlang/exercism_test_runner/_gleam_artefacts/exercism@test_runner.erl, line 134)
I haven’t seen this with any of the other 20 or so exercises I’ve done.