Skip to content

Commit

Permalink
fix: account for decoration changes in nightly
Browse files Browse the repository at this point in the history
  • Loading branch information
ckipp01 committed Feb 13, 2024
1 parent d90ea43 commit ce525a0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions tests/tests/decoration_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ describe("decorations", function()
local hover_contents = vim.api.nvim_buf_get_lines(bufs_after[#bufs_after], 0, 1, true)

assert.are.same(1, #hover_contents)
assert.are.same("x: Int 1", hover_contents[1])

-- A bit hacky but the next iteration of Neovim changes this a bit and just to make it easy
-- we check for both and just assert that it's one of the two. Once the new minor version of
-- Neovim comes out we can ditch this and instead check the entire contents.
local hover_result = hover_contents[1] == "x: Int 1" or hover_contents[1] == "```scala"
assert.are.same(true, hover_result)
end)

it("should be able to clear and replace existing decorations", function()
Expand All @@ -53,6 +58,11 @@ describe("decorations", function()
local hover_contents = vim.api.nvim_buf_get_lines(bufs_after[#bufs_after], 0, 1, true)

assert.are.same(1, #hover_contents)
assert.are.same("x: Int 2", hover_contents[1])

-- A bit hacky but the next iteration of Neovim changes this a bit and just to make it easy
-- we check for both and just assert that it's one of the two. Once the new minor version of
-- Neovim comes out we can ditch this and instead check the entire contents.
local hover_result = hover_contents[1] == "x: Int 2" or hover_contents[1] == "```scala"
assert.are.same(true, hover_result)
end)
end)

0 comments on commit ce525a0

Please sign in to comment.