fix tests for rename

main
Daniel Barlow 2023-01-02 18:22:46 +00:00
parent d39d7059b9
commit cc0f881fed
2 changed files with 7 additions and 6 deletions

View File

@ -122,8 +122,9 @@
(if (not result.active) (if (not result.active)
(completions-widget:hide)) (completions-widget:hide))
(set entry.text (or result.default result.error "")) (set entry.text (or result.default result.error ""))
(widget.parent:set_visible_child_name (when widget.parent
(if result.active "commander" "echo-area"))) (widget.parent:set_visible_child_name
(if result.active "commander" "echo-area"))))
(fn on-input [self str] (fn on-input [self str]
(match self.state (match self.state

View File

@ -20,7 +20,7 @@
(let [commander (Command.commander) (let [commander (Command.commander)
(ok err) (ok err)
(match-try (commander:activate) (match-try (commander:activate)
{:active true} (commander:on-activate "not-a-command") {:active true} (commander:on-input-finished "not-a-command")
(where {:error e :active false} (e:match "can't find command")) true (where {:error e :active false} (e:match "can't find command")) true
(catch (catch
x (values nil (view x))))] x (values nil (view x))))]
@ -30,9 +30,9 @@
(let [commander (Command.commander) (let [commander (Command.commander)
(ok err) (ok err)
(match-try (commander:activate) (match-try (commander:activate)
{:active true} (commander:on-activate "multiply") {:active true} (commander:on-input-finished "multiply")
{:active true :prompt p1} (commander:on-activate "2") {:active true :prompt p1} (commander:on-input-finished "2")
{:active true :prompt p2} (commander:on-activate "3") {:active true :prompt p2} (commander:on-input-finished "3")
(where {:active false} (= happened 6)) true (where {:active false} (= happened 6)) true
(catch (catch
x (values nil (view x))))] x (values nil (view x))))]