test: dispatch contract

This commit is contained in:
2026-03-09 22:04:30 +01:00
parent 1d66f31e19
commit 518373c2bb

View File

@@ -1,4 +1,26 @@
import gleam/dict
import gleeunit
import gleeunit/should
import simple_repl
pub fn command_lookup_test() {
let commands =
simple_repl.build_commands()
|> simple_repl.commands_dict
let has_help = case dict.get(commands, "help") {
Ok(_) -> True
Error(_) -> False
}
let has_unknown = case dict.get(commands, "foo") {
Ok(_) -> True
Error(_) -> False
}
has_help |> should.equal(True)
has_unknown |> should.equal(False)
}
pub fn main() -> Nil {
gleeunit.main()