From 0778c66917daba1a0dc948eacdf86578ec4dd2be Mon Sep 17 00:00:00 2001 From: Aki Date: Mon, 26 Aug 2024 01:55:02 +0200 Subject: User may now ask for multiple standards/tags from the CLI utility --- spec/parser_spec.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'spec/parser_spec.lua') 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) -- cgit v1.1