mirror of
https://github.com/hanzoai/hanzo.vim.git
synced 2026-11-09 15:19:11 +00:00
Lazy-load the Neural config before viewing a prompt, and update tests to reset state better.
36 lines
773 B
Plaintext
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)'))
|