diff options
| author | TJ DeVries <devries.timothyj@gmail.com> | 2020-08-24 12:31:57 -0400 |
|---|---|---|
| committer | TJ DeVries <devries.timothyj@gmail.com> | 2020-08-24 12:31:57 -0400 |
| commit | 1995ca53f38bb89f58a25b523cac59a07c09a0b8 (patch) | |
| tree | a170df7448d40ba9f1ddf307cb5849ceb5697905 /lua/tests | |
| parent | cfddae42f59eacbd792a8853be089f4711bbf4ba (diff) | |
Add fuzzy git file finderZ
Diffstat (limited to 'lua/tests')
| -rw-r--r-- | lua/tests/telescope_spec.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lua/tests/telescope_spec.lua b/lua/tests/telescope_spec.lua index c671579..9960772 100644 --- a/lua/tests/telescope_spec.lua +++ b/lua/tests/telescope_spec.lua @@ -1,5 +1,8 @@ require('plenary.test_harness'):setup_busted() +local log = require('telescope.log') +-- log.use_console = false + local pickers = require('telescope.pickers') local utils = require('telescope.utils') @@ -179,4 +182,20 @@ describe('Picker', function() end) end) +describe('Sorters', function() + describe('norcalli_sorter', function() + it('sort matches well', function() + local sorter = require('telescope.sorters').get_norcalli_sorter() + + local exact_match = sorter:score('hello', 'hello') + local no_match = sorter:score('abcdef', 'ghijkl') + local ok_match = sorter:score('abcdef', 'ab') + + assert(exact_match < no_match) + assert(exact_match < ok_match) + assert(ok_match < no_match) + end) + end) +end) + |
