test: adapt to list.find usage
This commit is contained in:
@@ -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
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user