Skip to content

Commit ae876ab

Browse files
authored
tests: Multi-byte surround. (#337)
I forgot the `find` key, so nothing was getting deleted 🤦.
1 parent 6a8f0f1 commit ae876ab

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

tests/configuration_spec.lua

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,25 +54,25 @@ describe("configuration", function()
5454
})
5555
end)
5656

57-
-- TODO: Figure out why the test can't detect the buffer change!!
58-
-- it("can define and use multi-byte mappings", function()
59-
-- require("nvim-surround").setup({
60-
-- surrounds = {
61-
-- -- multi-byte quote
62-
-- ["“"] = {
63-
-- add = { "„", "“" },
64-
-- delete = "^(„)().-(“)()$",
65-
-- },
66-
-- },
67-
-- })
68-
--
69-
-- set_lines({ "hey! hello world" })
70-
-- set_curpos({ 1, 7 })
71-
-- vim.cmd("normal ysiw“")
72-
-- check_lines({ "hey! „hello“ world" })
73-
-- vim.cmd("normal ds“")
74-
-- check_lines({ "hey! hello world" })
75-
-- end)
57+
it("can define and use multi-byte mappings", function()
58+
require("nvim-surround").setup({
59+
surrounds = {
60+
-- multi-byte quote
61+
[""] = {
62+
add = { "", "" },
63+
find = "„.-“",
64+
delete = "^(„)().-(“)()$",
65+
},
66+
},
67+
})
68+
69+
set_lines({ "hey! hello world" })
70+
set_curpos({ 1, 7 })
71+
vim.cmd("normal ysiw“")
72+
check_lines({ "hey! „hello“ world" })
73+
vim.cmd("normal ds“")
74+
check_lines({ "hey! hello world" })
75+
end)
7676

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

0 commit comments

Comments
 (0)