forked from api7/lua-tinyyaml
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |