summaryrefslogtreecommitdiff
path: root/spec/parser_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'spec/parser_spec.lua')
-rw-r--r--spec/parser_spec.lua17
1 files changed, 13 insertions, 4 deletions
diff --git a/spec/parser_spec.lua b/spec/parser_spec.lua
index f20ae0f..b2d91fc 100644
--- a/spec/parser_spec.lua
+++ b/spec/parser_spec.lua
@@ -55,12 +55,12 @@ describe("Headers", function()
it("are not available if never assigned", function()
headers:parse [[]]
- assert.is_nil(headers:get_headers("Example"))
+ assert.is_nil(headers:get_headers{"Example"})
end)
it("can be assigned to a tag", function()
headers:parse [[headers "Example" {"example.h"}]]
- assert.are.same({"example.h"}, headers:get_headers("Example"))
+ assert.are.same({"example.h"}, headers:get_headers{"Example"})
end)
it("can be included from another tag", function()
@@ -68,7 +68,7 @@ describe("Headers", function()
headers "Parent" {"example.h"}
headers "Derived" {include "Parent"}
]]
- assert.are.same({"example.h"}, headers:get_headers("Derived"))
+ assert.are.same({"example.h"}, headers:get_headers{"Derived"})
end)
it("can be removed after including from another tag", function()
@@ -76,6 +76,15 @@ describe("Headers", function()
headers "Parent" {"example.h", "removed.h"}
headers "Derived" {include "Parent", remove "removed.h"}
]]
- assert.are.same({"example.h"}, headers:get_headers("Derived"))
+ assert.are.same({"example.h"}, headers:get_headers{"Derived"})
+ end)
+
+ it("can be retrieved from number of tags", function()
+ headers:parse [[
+ headers "First" {"first.h"}
+ headers "Second" {"second.h"}
+ ]]
+ assert.are.same({"first.h"}, headers:get_headers{"First"})
+ assert.are.same({"first.h", "second.h"}, headers:get_headers{"First", "Second"})
end)
end)