Files
hanzo.vim/test/vim/test_view_prompt.vader
w0rp 49142a7384 Load the config before viewing a prompt
Lazy-load the Neural config before viewing a prompt, and update tests
to reset state better.
2024-06-02 14:07:49 +01:00

36 lines
773 B
Plaintext

Before:
Save g:neural
unlet! g:neural
let g:output = ''
After:
Restore
unlet! g:output
Given markdown(An empty Markdown file):
Execute(An empty markdown prompt should be explained correctly):
redir => g:output
silent NeuralViewPrompt
redir END
AssertEqual
\ [
\ 'The following prompt will be sent.',
\ 'Write text in a markdown file. '
\ ],
\ sort(filter(split(g:output, "\n"), '!empty(v:val)'))
Execute(A markdown prompt with some text should be explained correctly):
redir => g:output
silent NeuralViewPrompt here is some text
redir END
AssertEqual
\ [
\ 'The following prompt will be sent.',
\ 'Write text in a markdown file. here is some text'
\ ],
\ sort(filter(split(g:output, "\n"), '!empty(v:val)'))