Skip to content

Commit

Permalink
don't dependend on path in screen-test :|
Browse files Browse the repository at this point in the history
  • Loading branch information
L3MON4D3 committed Nov 18, 2023
1 parent e8c0261 commit 3a66e30
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions tests/integration/loaders_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -739,14 +739,9 @@ describe("loaders:", function()
exec_lua("vim.wait(100, function() end)")

ls_helpers.scratch_edit("snippets/all.lua")
feed(([[ireturn { ls.parser.parse_snippet("asdf", ls_tracked_dofile("%s")) }]]):format(ls_helpers.scratchdir_path .. "/util/a_string.lua"))
-- can't verify this via screenshot since the inserted path will vary :(
screen:expect{grid=[[
return { ls.parser.parse_snippet("asdf", ls_tracke|
d_dofile("/home/simon/Code/luasnip/tests/scratch/u|
til/a_string.lua")) }^ |
{0:~ }|
{2:-- INSERT --} |]]}
-- extract into variable, so the path does no show up in screen-tests.
exec_lua(([[dependency_file = "%s"]]):format(ls_helpers.scratchdir_path .. "/util/a_string.lua"))
feed([[ireturn { ls.parser.parse_snippet("asdf", ls_tracked_dofile(dependency_file)) }]])

feed("<Esc>:w<Cr>")
exec_lua("vim.wait(100, function() end)")
Expand All @@ -755,9 +750,9 @@ describe("loaders:", function()
exec_lua("ls.expand()")
screen:expect{grid=[[
return { ls.parser.parse_snippet("asdf", ls_tracke|
d_dofile("/home/simon/Code/luasnip/tests/scratch/u|
til/a_string.lua")) } |
d_dofile(dependency_file)) } |
qwer^ |
{0:~ }|
{2:-- INSERT --} |]]}

ls_helpers.scratch_edit("util/a_string.lua")
Expand Down

0 comments on commit 3a66e30

Please sign in to comment.