diff --git a/test/simple_repl_test.gleam b/test/simple_repl_test.gleam index 902c4da..375f96d 100644 --- a/test/simple_repl_test.gleam +++ b/test/simple_repl_test.gleam @@ -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()