From 518373c2bb97d82c21688a1bfca342cbba3c9b9a Mon Sep 17 00:00:00 2001 From: Kharec Date: Mon, 9 Mar 2026 22:04:30 +0100 Subject: [PATCH] test: dispatch contract --- test/simple_repl_test.gleam | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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()