aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/buffer_updates_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2021-10-08 18:19:18 +0200
committerGitHub <noreply@github.com>2021-10-08 18:19:18 +0200
commit5cbd0fba00ecc07099b6af919fed5f403a0ed1cb (patch)
tree6b26782c80505fd2515cca1174fc4be45fa4d6b4 /test/functional/lua/buffer_updates_spec.lua
parente9d6f7ca6c7739960e8f571f7e5dbe5e5c5ffc0a (diff)
parentef687d3218adcb55698a03c3b21b625195e0ba98 (diff)
downloadrneovim-5cbd0fba00ecc07099b6af919fed5f403a0ed1cb.tar.gz
rneovim-5cbd0fba00ecc07099b6af919fed5f403a0ed1cb.tar.bz2
rneovim-5cbd0fba00ecc07099b6af919fed5f403a0ed1cb.zip
Merge pull request #15962 from bfredl/nosort
fix(buffer_updates): handle :sort of already sorted buffer
Diffstat (limited to 'test/functional/lua/buffer_updates_spec.lua')
-rw-r--r--test/functional/lua/buffer_updates_spec.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/functional/lua/buffer_updates_spec.lua b/test/functional/lua/buffer_updates_spec.lua
index 83ed7394b0..c83a50b78b 100644
--- a/test/functional/lua/buffer_updates_spec.lua
+++ b/test/functional/lua/buffer_updates_spec.lua
@@ -1088,6 +1088,22 @@ describe('lua: nvim_buf_attach on_bytes', function()
}
end)
+ it(":sort lines", function()
+ local check_events = setup_eventcheck(verify, {"CCC", "BBB", "AAA"})
+
+ command "%sort"
+ check_events {
+ { "test1", "bytes", 1, 3, 0, 0, 0, 3, 0, 12, 3, 0, 12 };
+ }
+ end)
+
+ it("handles already sorted lines", function()
+ local check_events = setup_eventcheck(verify, {"AAA", "BBB", "CCC"})
+
+ command "%sort"
+ check_events { }
+ end)
+
local function test_lockmarks(mode)
local description = (mode ~= "") and mode or "(baseline)"
it("test_lockmarks " .. description .. " %delete _", function()