howl.interactions.search

local searcher

before_each ->
  searcher = {}
  app.editor = :searcher

registers interactions

assert.not_nil interact.forward_search
assert.not_nil interact.backward_search
assert.not_nil interact.forward_search_word
assert.not_nil interact.backward_search_word

searches forward for typed text

searcher.forward_to = spy.new -> true
within_command_line (-> interact.forward_search {}), (command_line) ->
  command_line\write 'tw'
assert.spy(searcher.forward_to).was_called_with match.is_ref(searcher), 'tw', 'plain'

interact.forward_search_word

searches forward for typed word

searcher.forward_to = spy.new -> true
within_command_line (-> interact.forward_search_word {}), (command_line) ->
  command_line\write 'tw'
assert.spy(searcher.forward_to).was_called_with match.is_ref(searcher), 'tw', 'word'