Skip to content

Commit

Permalink
Adds tests to yanking values
Browse files Browse the repository at this point in the history
  • Loading branch information
cuducos authored and joshzcold committed Nov 3, 2023
1 parent e1b4060 commit be021cc
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/yaml_nvim/commands_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,24 @@ describe("commands", function()

assert(vim.fn.getreg("7"), "worldcup")
end)

it("yanks value to the default register", function()
require("yaml_nvim")

vim.cmd(":e sample.yaml")
vim.cmd("norm 10j")
vim.cmd(":YAMLYankValue")

assert(vim.fn.getreg('"'), "7")
end)

it("yanks value to a custom register", function()
require("yaml_nvim")

vim.cmd(":e sample.yaml")
vim.cmd("norm 10j")
vim.cmd(":YAMLYankValue 7")

assert(vim.fn.getreg("7"), "7")
end)
end)

0 comments on commit be021cc

Please sign in to comment.