-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathspec.lua
More file actions
21 lines (18 loc) · 701 Bytes
/
spec.lua
File metadata and controls
21 lines (18 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
describe("String Functions", function()
local stringExt = require("string_ext")
it("doubleQuote", function()
local inputStr = "Original string"
local expectedOutput = "\"Original string\""
assert.are.same( expectedOutput, stringExt.doubleQuote(inputStr) )
end)
it("toSqlString - input without quotes", function()
local inputStr = "dog"
local expectedOutput = "'dog'"
assert.are.same( expectedOutput, stringExt.toSqlString(inputStr) )
end)
it("toSqlString - input with quotes inside", function()
local inputStr = "dog's day out"
local expectedOutput = "'dog'''s day out'"
assert.are.same( expectedOutput, stringExt.toSqlString(inputStr) )
end)
end)