Skip to content

Commit

Permalink
chore: add case tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorias committed Jan 5, 2024
1 parent e2652d0 commit b6f546c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions tests/coerce/case_spec.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
local cc = require("coerce.case")

describe("coerce.case", function()
describe("to_camel_case", function()
it("converts to camel case", function()
assert.are.same("ąbęÓcki", cc.to_camel_case("ąbę-ócki"))
end)
end)
describe("to_dot_case", function()
it("converts to dot case", function()
assert.are.same("ąbę.ócki", cc.to_dot_case("ąbę-ócki"))
end)
end)
describe("to_kebab_case", function()
it("converts to kebab case", function()
assert.are.same("ąbę-ócki", cc.to_kebab_case("ąbęÓcki"))
end)
end)
describe("to_pascal_case", function()
it("converts to pascal case", function()
assert.are.same("ĄbęÓcki", cc.to_pascal_case("ąbęÓcki"))
end)
end)
describe("to_snake_case", function()
it("converts to pascal case", function()
assert.are.same("ąbę_ócki", cc.to_snake_case("ąbęÓcki"))
end)
end)
describe("to_upper_case", function()
it("converts to upper case", function()
assert.are.same("ĄBĘ_ÓCKI", cc.to_upper_case("ąbęÓcki"))
end)
end)
describe("to_numerical_contraction", function()
it("converts a complex Unicode string its numerical contraction", function()
local char2nr = vim.fn.char2nr
Expand Down

0 comments on commit b6f546c

Please sign in to comment.