Skip to content

Commit e5f3ea4

Browse files
committed
Reformat md swap specs
Just some early winter cleaning
1 parent 61e6f95 commit e5f3ea4

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

tests/treewalker/swap_spec.lua

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,26 @@ describe("Swapping in a regular lua file:", function()
125125
end)
126126
end)
127127

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

135-
it("turns off in md files (doesn't work at all there, doesn't need to)", function()
135+
it("turns off for down in md files", function()
136+
vim.fn.cursor(1, 1)
136137
local lines_before = lines.get_lines(0, -1)
137-
tw.swap_up()
138138
tw.swap_down()
139139
local lines_after = lines.get_lines(0, -1)
140140
assert.same(lines_after, lines_before)
141141
end)
142+
143+
it("turns off for up in md files", function()
144+
vim.fn.cursor(3, 1)
145+
local lines_before = lines.get_lines(0, -1)
146+
tw.swap_up()
147+
local lines_after = lines.get_lines(0, -1)
148+
assert.same(lines_after, lines_before)
149+
end)
142150
end)

0 commit comments

Comments
 (0)