From 75c6389e9deb4c223097123e8c091fb696a57e56 Mon Sep 17 00:00:00 2001 From: John MacFarlane <jgm@berkeley.edu> Date: Fri, 4 Feb 2022 10:36:58 -0800 Subject: [PATCH] Add endnotexml reader test. --- test/Tests/Old.hs | 3 + test/endnotexml-reader.native | 109 +++++++++++++++++ test/endnotexml-reader.xml | 216 ++++++++++++++++++++++++++++++++++ 3 files changed, 328 insertions(+) create mode 100644 test/endnotexml-reader.native create mode 100644 test/endnotexml-reader.xml diff --git a/test/Tests/Old.hs b/test/Tests/Old.hs index 9f47df17d..a64469e6d 100644 --- a/test/Tests/Old.hs +++ b/test/Tests/Old.hs @@ -211,6 +211,9 @@ tests pandocPath = ] , testGroup "rtf" [ testGroup "writer" $ writerTests' "rtf" ] + , testGroup "endnotexml" + [ test' "reader" ["-r", "endnotexml", "-w", "native", "-s"] + "endnotexml-reader.xml" "endnotexml-reader.native" ] , testGroup "ipynb" [ test' "reader" ["-f", "ipynb-raw_html-raw_tex+raw_attribute", "-t", "native", "-s"] diff --git a/test/endnotexml-reader.native b/test/endnotexml-reader.native new file mode 100644 index 000000000..6e346e9fb --- /dev/null +++ b/test/endnotexml-reader.native @@ -0,0 +1,109 @@ +Pandoc + Meta + { unMeta = + fromList + [ ( "references" + , MetaList + [ MetaMap + (fromList + [ ( "author" + , MetaList + [ MetaMap + (fromList + [ ( "family" + , MetaString "Chapman" + ) + , ( "given" , MetaString "A. G." ) + ]) + ] + ) + , ( "container-title" + , MetaInlines [ Str "Ecology" ] + ) + , ( "id" , MetaString "13264" ) + , ( "isbn" , MetaInlines [ Str "0012-9658" ] ) + , ( "issued" , MetaString "1937" ) + , ( "number" , MetaInlines [ Str "1" ] ) + , ( "pages" , MetaInlines [ Str "93-105" ] ) + , ( "title" + , MetaInlines + [ Str "An" + , SoftBreak + , Str "ecological" + , Space + , Str "basis" + , Space + , Str "for" + , Space + , Str "reforestation" + , Space + , Str "of" + , Space + , Str "submariginal" + , Space + , Str "lands" + , SoftBreak + , Str "in" + , Space + , Str "the" + , Space + , Str "Central" + , Space + , Str "Hardwood" + , Space + , Str "Region" + ] + ) + , ( "type" , MetaString "article-journal" ) + , ( "volume" , MetaInlines [ Str "18" ] ) + ]) + , MetaMap + (fromList + [ ( "author" + , MetaList + [ MetaMap + (fromList + [ ( "family" + , MetaString "Strohecker" + ) + , ( "given" , MetaString "H. F." ) + ]) + ] + ) + , ( "container-title" + , MetaInlines [ Str "Ecology" ] + ) + , ( "id" , MetaString "13265" ) + , ( "isbn" , MetaInlines [ Str "0012-9658" ] ) + , ( "issued" , MetaString "1937" ) + , ( "number" , MetaInlines [ Str "1" ] ) + , ( "pages" , MetaInlines [ Str "162-168" ] ) + , ( "title" + , MetaInlines + [ Str "A" + , Space + , Str "survey" + , SoftBreak + , Str "of" + , Space + , Str "soil" + , Space + , Str "temperatures" + , Space + , Str "in" + , Space + , Str "the" + , Space + , Str "Chicago" + , Space + , Str "area" + ] + ) + , ( "type" , MetaString "article-journal" ) + , ( "volume" , MetaInlines [ Str "18" ] ) + ]) + ] + ) + ] + } + [] diff --git a/test/endnotexml-reader.xml b/test/endnotexml-reader.xml new file mode 100644 index 000000000..bfd4e79b0 --- /dev/null +++ b/test/endnotexml-reader.xml @@ -0,0 +1,216 @@ +<?xml version="1.0" encoding="utf-8"?> +<xml> + <records> + <record> + <database name="EndNote Ecology.enl" + path="/Users/LowDecarie/Dropbox/Meta presentation of stats/Data/EndNote Ecology.enl"> + EndNote Ecology.enl</database> + <source-app name="EndNote" version="15.0"> + EndNote</source-app> + <rec-number>13264</rec-number> + <foreign-keys> + <key app="EN" db-id="0xxzez5ectezp7e9zrnxp0dq5zrafepwxfe2"> + 13264</key> + </foreign-keys> + <ref-type name="Journal Article">17</ref-type> + <contributors> + <authors> + <author> + <style face="normal" font="default" size="100%"> + Chapman, A. G.</style> + </author> + </authors> + </contributors> + <auth-address> + <style face="normal" font="default" size="100%">Cent States + Forest Expt Stn, Columbus, OH USA</style> + </auth-address> + <titles> + <title> + <style face="normal" font="default" size="100%">An + ecological basis for reforestation of submariginal lands + in the Central Hardwood Region</style> + </title> + <secondary-title> + <style face="normal" font="default" size="100%"> + Ecology</style> + </secondary-title> + <alt-title> + <style face="normal" font="default" size="100%"> + Ecology</style> + </alt-title> + </titles> + <periodical> + <full-title> + <style face="normal" font="default" size="100%"> + Ecology</style> + </full-title> + <abbr-1> + <style face="normal" font="default" size="100%"> + Ecology</style> + </abbr-1> + </periodical> + <alt-periodical> + <full-title> + <style face="normal" font="default" size="100%"> + Ecology</style> + </full-title> + <abbr-1> + <style face="normal" font="default" size="100%"> + Ecology</style> + </abbr-1> + </alt-periodical> + <pages> + <style face="normal" font="default" size="100%"> + 93-105</style> + </pages> + <volume> + <style face="normal" font="default" size="100%">18</style> + </volume> + <number> + <style face="normal" font="default" size="100%">1</style> + </number> + <dates> + <year> + <style face="normal" font="default" size="100%"> + 1937</style> + </year> + <pub-dates> + <date> + <style face="normal" font="default" size="100%"> + Jan</style> + </date> + </pub-dates> + </dates> + <isbn> + <style face="normal" font="default" size="100%"> + 0012-9658</style> + </isbn> + <accession-num> + <style face="normal" font="default" size="100%"> + ISI:000200148800007</style> + </accession-num> + <notes> + <style face="normal" font="default" size="100%">V02fg Times + Cited:5 Cited References Count:2</style> + </notes> + <urls> + <related-urls> + <url> + <style face="normal" font="default" size="100%"><Go + to ISI>://000200148800007</style> + </url> + </related-urls> + </urls> + <language> + <style face="normal" font="default" size="100%"> + English</style> + </language> + </record> + <record> + <database name="EndNote Ecology.enl" + path="/Users/LowDecarie/Dropbox/Meta presentation of stats/Data/EndNote Ecology.enl"> + EndNote Ecology.enl</database> + <source-app name="EndNote" version="15.0"> + EndNote</source-app> + <rec-number>13265</rec-number> + <foreign-keys> + <key app="EN" db-id="0xxzez5ectezp7e9zrnxp0dq5zrafepwxfe2"> + 13265</key> + </foreign-keys> + <ref-type name="Journal Article">17</ref-type> + <contributors> + <authors> + <author> + <style face="normal" font="default" size="100%"> + Strohecker, H. F.</style> + </author> + </authors> + </contributors> + <auth-address> + <style face="normal" font="default" size="100%">Univ + Chicago, Chicago, IL USA</style> + </auth-address> + <titles> + <title> + <style face="normal" font="default" size="100%">A survey + of soil temperatures in the Chicago area</style> + </title> + <secondary-title> + <style face="normal" font="default" size="100%"> + Ecology</style> + </secondary-title> + <alt-title> + <style face="normal" font="default" size="100%"> + Ecology</style> + </alt-title> + </titles> + <periodical> + <full-title> + <style face="normal" font="default" size="100%"> + Ecology</style> + </full-title> + <abbr-1> + <style face="normal" font="default" size="100%"> + Ecology</style> + </abbr-1> + </periodical> + <alt-periodical> + <full-title> + <style face="normal" font="default" size="100%"> + Ecology</style> + </full-title> + <abbr-1> + <style face="normal" font="default" size="100%"> + Ecology</style> + </abbr-1> + </alt-periodical> + <pages> + <style face="normal" font="default" size="100%"> + 162-168</style> + </pages> + <volume> + <style face="normal" font="default" size="100%">18</style> + </volume> + <number> + <style face="normal" font="default" size="100%">1</style> + </number> + <dates> + <year> + <style face="normal" font="default" size="100%"> + 1937</style> + </year> + <pub-dates> + <date> + <style face="normal" font="default" size="100%"> + Jan</style> + </date> + </pub-dates> + </dates> + <isbn> + <style face="normal" font="default" size="100%"> + 0012-9658</style> + </isbn> + <accession-num> + <style face="normal" font="default" size="100%"> + ISI:000200148800014</style> + </accession-num> + <notes> + <style face="normal" font="default" size="100%">V02fg Times + Cited:5 Cited References Count:14</style> + </notes> + <urls> + <related-urls> + <url> + <style face="normal" font="default" size="100%"><Go + to ISI>://000200148800014</style> + </url> + </related-urls> + </urls> + <language> + <style face="normal" font="default" size="100%"> + English</style> + </language> + </record> + </records> +</xml>