-
-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(test_harness): floating results window (#520)
* Resolved invalid escape sequence error caused by Windows backslash in filepaths. * PlenaryBustedDirectory now works with no path issues, and the PlenaryTestFile keymap now properly tests only the file. * Refactored test running and floating window logic out into _test_paths and made test_directory only responsible for passing a list of test files to the new _test_paths function. Finally added a test_file function which calls _test_paths with only one path: the current file. * Update fix to be unique to Windows machines. For some reason, Path:absolute behaves differently on Linux.
- Loading branch information
Showing
2 changed files
with
22 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
|
||
" Create command for running busted | ||
command! -nargs=1 -complete=file PlenaryBustedFile | ||
\ lua require('plenary.busted').run(vim.fn.expand([[<args>]])) | ||
\ lua require('plenary.test_harness').test_file([[<args>]]) | ||
|
||
command! -nargs=+ -complete=file PlenaryBustedDirectory | ||
\ lua require('plenary.test_harness').test_directory_command([[<args>]]) | ||
|
||
nnoremap <Plug>PlenaryTestFile :lua require('plenary.test_harness').test_directory(vim.fn.expand("%:p"))<CR> | ||
nnoremap <Plug>PlenaryTestFile :lua require('plenary.test_harness').test_file(vim.fn.expand("%:p"))<CR> |