summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-08-26 01:55:02 +0200
committerAki <please@ignore.pl>2024-08-26 01:55:02 +0200
commit0778c66917daba1a0dc948eacdf86578ec4dd2be (patch)
tree4abde2008d8d0ee0e846c5fb734b0fe95c048378 /spec
parenta3c88e98886a4dc149b0e55059f8bcdc5d345f18 (diff)
downloadheaders-0778c66917daba1a0dc948eacdf86578ec4dd2be.zip
headers-0778c66917daba1a0dc948eacdf86578ec4dd2be.tar.gz
headers-0778c66917daba1a0dc948eacdf86578ec4dd2be.tar.bz2
User may now ask for multiple standards/tags from the CLI utility
Diffstat (limited to 'spec')
-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)