Skip to content

Commit

Permalink
Unit-test api7#10
Browse files Browse the repository at this point in the history
  • Loading branch information
Witiko committed Sep 12, 2021
1 parent 264cead commit ee07191
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions spec/emptylines_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
local busted = require 'busted'
local assert = require 'luassert'
local yaml = require 'tinyyaml'

busted.describe("empty lines", function()
busted.it("multi-line scalar", function()
assert.same(
{
abstract = "This is the abstract.\nIt consists of two paragraphs.\n"
},
yaml.parse([[
abstract: |
This is the abstract.
It consists of two paragraphs.
]])
)
assert.same(
{
abstract = "This is the abstract.\n\nIt consists of two paragraphs.\n"
},
yaml.parse([[
abstract: |
This is the abstract.
It consists of two paragraphs.
]])
)
assert.same(
{
abstract = "This is the abstract.\n\n\nIt consists of two paragraphs.\n"
},
yaml.parse([[
abstract: |
This is the abstract.
It consists of two paragraphs.
]])
)
end)
end)

0 comments on commit ee07191

Please sign in to comment.