1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 09:40:04 +08:00
SpaceVim/bundle/plenary.nvim/tests/plenary/rotate_spec.lua
2022-05-16 22:20:10 +08:00

19 lines
422 B
Lua

local rotate = require("plenary.vararg").rotate
local eq = vim.deep_equal
describe("rotate", function()
it("should rotate varargs", function()
eq({ rotate(1, 2, 3) }, { 2, 3, 1 })
eq({ rotate(1, 2, 3, 4, 5, 6, 7, 8, 9) }, { 2, 3, 4, 5, 6, 7, 8, 9, 1 })
end)
it("should rotate none", function()
eq({ rotate() }, {})
end)
it("should rotate one", function()
eq({ rotate(1) }, { 1 })
end)
end)