diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/api/vim_spec.lua | 31 | ||||
-rw-r--r-- | test/functional/lua/treesitter_spec.lua | 8 | ||||
-rw-r--r-- | test/functional/ui/fold_spec.lua | 27 |
3 files changed, 58 insertions, 8 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 7948f7da09..eb5fd7eca7 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -1885,25 +1885,40 @@ describe('API', function() end) describe('nvim_get_runtime_file', function() - it('works', function() + local p = helpers.alter_slashes + it('can find files', function() eq({}, meths.get_runtime_file("bork.borkbork", false)) eq({}, meths.get_runtime_file("bork.borkbork", true)) eq(1, #meths.get_runtime_file("autoload/msgpack.vim", false)) eq(1, #meths.get_runtime_file("autoload/msgpack.vim", true)) local val = meths.get_runtime_file("autoload/remote/*.vim", true) eq(2, #val) - local p = helpers.alter_slashes if endswith(val[1], "define.vim") then - ok(endswith(val[1], p("autoload/remote/define.vim"))) - ok(endswith(val[2], p("autoload/remote/host.vim"))) + ok(endswith(val[1], p"autoload/remote/define.vim")) + ok(endswith(val[2], p"autoload/remote/host.vim")) else - ok(endswith(val[1], p("autoload/remote/host.vim"))) - ok(endswith(val[2], p("autoload/remote/define.vim"))) + ok(endswith(val[1], p"autoload/remote/host.vim")) + ok(endswith(val[2], p"autoload/remote/define.vim")) end val = meths.get_runtime_file("autoload/remote/*.vim", false) eq(1, #val) - ok(endswith(val[1], p("autoload/remote/define.vim")) - or endswith(val[1], p("autoload/remote/host.vim"))) + ok(endswith(val[1], p"autoload/remote/define.vim") + or endswith(val[1], p"autoload/remote/host.vim")) + + eq({}, meths.get_runtime_file("lua", true)) + eq({}, meths.get_runtime_file("lua/vim", true)) + end) + + it('can find directories', function() + local val = meths.get_runtime_file("lua/", true) + eq(1, #val) + ok(endswith(val[1], p"lua/")) + + val = meths.get_runtime_file("lua/vim/", true) + eq(1, #val) + ok(endswith(val[1], p"lua/vim/")) + + eq({}, meths.get_runtime_file("foobarlang/", true)) end) end) end) diff --git a/test/functional/lua/treesitter_spec.lua b/test/functional/lua/treesitter_spec.lua index 273a5119cb..65dc1b3e03 100644 --- a/test/functional/lua/treesitter_spec.lua +++ b/test/functional/lua/treesitter_spec.lua @@ -781,6 +781,14 @@ local hl_query = [[ ]] eq(range, { { 0, 0, 18, 1 } }) + + local range_tbl = exec_lua [[ + parser:set_included_regions { { { 0, 0, 17, 1 } } } + parser:parse() + return parser:included_regions() + ]] + + eq(range_tbl, { { { 0, 0, 0, 17, 1, 508 } } }) end) it("allows to set complex ranges", function() if not check_parser() then return end diff --git a/test/functional/ui/fold_spec.lua b/test/functional/ui/fold_spec.lua index 669ec5d3ed..018049d2f4 100644 --- a/test/functional/ui/fold_spec.lua +++ b/test/functional/ui/fold_spec.lua @@ -117,6 +117,33 @@ describe("folded lines", function() end end) + it("work with spell", function() + command("set spell") + insert([[ + This is a + valid English + sentence composed by + an exhausted developer + in his cave. + ]]) + + feed("gg") + feed("zf3j") + if not multigrid then + -- screen:snapshot_util() + screen:expect{grid=[[ + {5:^+-- 4 lines: This is a······················}| + in his cave. | + | + {1:~ }| + {1:~ }| + {1:~ }| + {1:~ }| + | + ]]} + end + end) + it("works with multibyte fillchars", function() insert([[ aa |