Skip to content

Commit

Permalink
add some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
wd60622 committed Feb 20, 2025
1 parent 631ab6f commit 09d1093
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions lua/tests/plenary/gh_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,41 @@ describe("insert_args:", function()
}
eq(args, expected)
end)
it("Replace mapping default", function()
local args = {}
local opts = {
remove_label = "Some label",
}
gh.insert_args(args, opts)
local expected = {
"--remove_label",
"Some label",
}
eq(args, expected)
end)
it("Replace mapping underscores", function()
local args = {}
local opts = {
remove_label = "Some label",
}
gh.insert_args(args, opts, { ["_"] = "-" })
local expected = {
"--remove-label",
"Some label",
}
eq(args, expected)
end)
it("Replace mapping underscores boolean", function()
local args = {}
local opts = {
remove_milestone = true,
}
gh.insert_args(args, opts, { ["_"] = "-" })
local expected = {
"--remove-milestone",
}
eq(args, expected)
end)
it("single characters have single hyphen", function()
local args = {}
local opts = {
Expand Down

0 comments on commit 09d1093

Please sign in to comment.