Skip to content

Commit

Permalink
Added unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Piterden committed Aug 14, 2023
1 parent c90f9e6 commit 850f831
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions spec/gears/string_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,17 @@ describe("gears.string", function()
assert.is_same(gstring.split("foo\n", "\n"), {"foo", ""})
assert.is_same(gstring.split("foo\nbar", "\n"), {"foo", "bar"})

assert.is_same(gstring.split("", "%."), {""})
assert.is_same(gstring.split(".", "%."), {"", ""})
assert.is_same(gstring.split("foo", "%."), {"foo"})
assert.is_same(gstring.split("foo.", "%."), {"foo", ""})
assert.is_same(gstring.split("foo.bar", "%."), {"foo", "bar"})

assert.is_same(gstring.split("", "."), {""})
assert.is_same(gstring.split(".", "."), {"", ""})
assert.is_same(gstring.split("foo", "."), {"foo"})
assert.is_same(gstring.split("foo.", "."), {"foo", ""})
assert.is_same(gstring.split("foo.bar", "."), {"foo", "bar"})
assert.is_same(gstring.split("a", "."), {"", ""})
assert.is_same(gstring.split("foo", "."), {"", "", "", ""})
assert.is_same(gstring.split("foo.", "%W"), {"foo", ""})
assert.is_same(gstring.split(".foo.2.5.bar.73", "%.%d"), {".foo", "", ".bar", "3"})
end)
end)

Expand Down

0 comments on commit 850f831

Please sign in to comment.