Skip to content

Commit

Permalink
tests: Multi-byte surround. (#337)
Browse files Browse the repository at this point in the history
I forgot the `find` key, so nothing was getting deleted 🤦.
  • Loading branch information
kylechui committed Jun 7, 2024
1 parent 6a8f0f1 commit ae876ab
Showing 1 changed file with 19 additions and 19 deletions.
38 changes: 19 additions & 19 deletions tests/configuration_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,25 +54,25 @@ describe("configuration", function()
})
end)

-- TODO: Figure out why the test can't detect the buffer change!!
-- it("can define and use multi-byte mappings", function()
-- require("nvim-surround").setup({
-- surrounds = {
-- -- multi-byte quote
-- ["“"] = {
-- add = { "„", "“" },
-- delete = "^(„)().-(“)()$",
-- },
-- },
-- })
--
-- set_lines({ "hey! hello world" })
-- set_curpos({ 1, 7 })
-- vim.cmd("normal ysiw“")
-- check_lines({ "hey! „hello“ world" })
-- vim.cmd("normal ds“")
-- check_lines({ "hey! hello world" })
-- end)
it("can define and use multi-byte mappings", function()
require("nvim-surround").setup({
surrounds = {
-- multi-byte quote
[""] = {
add = { "", "" },
find = "„.-“",
delete = "^(„)().-(“)()$",
},
},
})

set_lines({ "hey! hello world" })
set_curpos({ 1, 7 })
vim.cmd("normal ysiw“")
check_lines({ "hey! „hello“ world" })
vim.cmd("normal ds“")
check_lines({ "hey! hello world" })
end)

it("can define and use 'interpreted' multi-byte mappings", function()
require("nvim-surround").setup({
Expand Down

0 comments on commit ae876ab

Please sign in to comment.