test: adapt to list.find usage

This commit is contained in:
2026-03-16 17:07:51 +01:00
parent 0e9c1dbb01
commit f64af89e9b

View File

@@ -1,19 +1,17 @@
import gleam/dict import gleam/list
import gleeunit import gleeunit
import gleeunit/should import gleeunit/should
import simple_repl import simple_repl
pub fn command_lookup_test() { pub fn command_lookup_test() {
let commands = let commands = simple_repl.build_commands()
simple_repl.build_commands()
|> simple_repl.commands_dict
let has_help = case dict.get(commands, "help") { let has_help = case list.find(commands, fn(c) { c.name == "help" }) {
Ok(_) -> True Ok(_) -> True
Error(_) -> False Error(_) -> False
} }
let has_unknown = case dict.get(commands, "foo") { let has_unknown = case list.find(commands, fn(c) { c.name == "foo" }) {
Ok(_) -> True Ok(_) -> True
Error(_) -> False Error(_) -> False
} }