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 11, 2021
1 parent 264cead commit 4954cfe
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions spec/blanks_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
local busted = require 'busted'
local assert = require 'luassert'
local yaml = require 'tinyyaml'

busted.describe("blanks", function()

busted.it("multi-line scalar without blanks:", 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.
]])
)
end)

busted.it("multi-line scalar with one blank:", function()
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.
]])
)
end)

busted.it("multi-line scalar with two blanks:", function()
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 4954cfe

Please sign in to comment.