Skip to content

Commit

Permalink
Add a unit test for utils.split_lines
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeterv committed Nov 18, 2016
1 parent 3a8d724 commit 1af819f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions spec/utils_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,12 @@ describe("utils", function()
end)
end)

describe("split_lines", function()
it("considers \\n, \\r, \\r\\n, and \\n\\r line endings", function()
assert.same({"foo", "", "bar", "baz", "", "quux", "line ", "another one"}, utils.split_lines("foo\n\nbar\r\nbaz\r\rquux\n\rline \nanother one"))
end)
end)

describe("map", function()
it("maps function over an array", function()
assert.same({3, 1, 2}, utils.map(math.sqrt, {9, 1, 4}))
Expand Down

0 comments on commit 1af819f

Please sign in to comment.