summaryrefslogtreecommitdiff
path: root/srcinfo_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'srcinfo_spec.lua')
-rw-r--r--srcinfo_spec.lua20
1 files changed, 14 insertions, 6 deletions
diff --git a/srcinfo_spec.lua b/srcinfo_spec.lua
index b0b574b..2312905 100644
--- a/srcinfo_spec.lua
+++ b/srcinfo_spec.lua
@@ -2,15 +2,23 @@ local srcinfo = require "srcinfo"
local stx = require "pl.stringx"
-describe("Parses empty content in", function()
- it("pkgname mode (default)", function()
- local pkgs = srcinfo""
- assert.are.same({}, pkgs)
+describe("Empty strings ared parsed successfully in", function()
+ it("pkgname mode", function()
+ assert.are.same({}, srcinfo"")
+ assert.are.same({}, srcinfo"\n")
+ assert.are.same({}, srcinfo" ")
+ assert.are.same({}, srcinfo"\n ")
+ assert.are.same({}, srcinfo" \n")
+ assert.are.same({}, srcinfo" \n ")
end)
it("pkgbase mode", function()
- local bases = srcinfo("", {mode="pkgbase"})
- assert.are.same({}, bases)
+ assert.are.same({}, srcinfo("", {mode="pkgbase"}))
+ assert.are.same({}, srcinfo("\n", {mode="pkgbase"}))
+ assert.are.same({}, srcinfo(" ", {mode="pkgbase"}))
+ assert.are.same({}, srcinfo("\n ", {mode="pkgbase"}))
+ assert.are.same({}, srcinfo(" \n", {mode="pkgbase"}))
+ assert.are.same({}, srcinfo(" \n ", {mode="pkgbase"}))
end)
end)