Skip to content

Commit

Permalink
Reformat md swap specs
Browse files Browse the repository at this point in the history
Just some early winter cleaning
  • Loading branch information
aaronik committed Jan 3, 2025
1 parent 61e6f95 commit e5f3ea4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions tests/treewalker/swap_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -125,18 +125,26 @@ describe("Swapping in a regular lua file:", function()
end)
end)

-- doesn't work at all in md, doesn't need to
describe("Swapping in a markdown file:", function()
before_each(function()
-- TODO This is a hack, really should be able to load a md file. Fix this.
load_fixture("/lua.lua")
load_fixture("/markdown.md")
vim.bo[0].filetype = "markdown"
end)

it("turns off in md files (doesn't work at all there, doesn't need to)", function()
it("turns off for down in md files", function()
vim.fn.cursor(1, 1)
local lines_before = lines.get_lines(0, -1)
tw.swap_up()
tw.swap_down()
local lines_after = lines.get_lines(0, -1)
assert.same(lines_after, lines_before)
end)

it("turns off for up in md files", function()
vim.fn.cursor(3, 1)
local lines_before = lines.get_lines(0, -1)
tw.swap_up()
local lines_after = lines.get_lines(0, -1)
assert.same(lines_after, lines_before)
end)
end)

0 comments on commit e5f3ea4

Please sign in to comment.