Skip to content

Commit

Permalink
Remove test code
Browse files Browse the repository at this point in the history
  • Loading branch information
jdutant committed Dec 16, 2024
1 parent 6a9ae37 commit 0c653a5
Showing 1 changed file with 4 additions and 30 deletions.
34 changes: 4 additions & 30 deletions src/CitationIdList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -225,37 +225,11 @@ function CitationIdList:insertInNocite(meta)
return meta
end

--- Use this to run command line tests (with pandoc lua)
if arg and arg[0] == debug.getinfo(1, "S").source:sub(2) then
--- Use this to run command line tests with pandoc lua
-- if arg and arg[0] == debug.getinfo(1, "S").source:sub(2) then

local SRC =
[[---
bibliography: ../test/references.bib
dummy: |
@Doe2020, @Doe2018
---
Hello.
]]

local mymeta = pandoc.Meta{thanks =
pandoc.Cite('nothing',{pandoc.Citation('Smith','AuthorInText')})
}
local myblocks = pandoc.Para{
pandoc.Cite('nothing',{pandoc.Citation('Jones','AuthorInText')})
}
local mydoc = pandoc.Pandoc(myblocks,mymeta)
local mycites = CitationIdList:new({'hello','john'})
mycites:addFromReferences(pandoc.read(SRC, 'markdown'))
mycites:addFromCitationIds(CitationIdList:new(mydoc).data)
local newcites = CitationIdList:new{'john','Doe2020'}
test = mycites:minus(newcites)

for _,item in ipairs(test.data) do
print(item)
end

else
-- else

return CitationIdList

end
-- end

0 comments on commit 0c653a5

Please sign in to comment.