aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlexander Krotov <ilabdsf@gmail.com>2018-09-02 17:26:43 +0300
committerAlexander Krotov <ilabdsf@gmail.com>2018-09-02 17:37:19 +0300
commit02e68859ebe964002b42d76ecbd3eea51a3e1f33 (patch)
tree5cf4e5837871655c41179ecd499c4a8dcac08692 /test
parent1630a731ec35d3e8538561b7824c135303fe4bdb (diff)
downloadpandoc-02e68859ebe964002b42d76ecbd3eea51a3e1f33.tar.gz
Muse reader: autonumber sections in the correct order
Parsing now stops at each section header to ensure the header is registered before parsing of the next section starts.
Diffstat (limited to 'test')
-rw-r--r--test/Tests/Readers/Muse.hs12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Tests/Readers/Muse.hs b/test/Tests/Readers/Muse.hs
index ca3324e34..edb8ba21a 100644
--- a/test/Tests/Readers/Muse.hs
+++ b/test/Tests/Readers/Muse.hs
@@ -625,6 +625,18 @@ tests =
T.unlines [ "* Foo"
, "bar"
] =?> header 1 "Foo\nbar"
+ , test (purely $ readMuse def { readerExtensions = extensionsFromList [Ext_amuse, Ext_auto_identifiers]})
+ "Auto identifiers"
+ (T.unlines [ "* foo"
+ , "** Foo"
+ , "* bar"
+ , "** foo"
+ , "* foo"
+ ] =?> headerWith ("foo",[],[]) 1 "foo" <>
+ headerWith ("foo-1",[],[]) 2 "Foo" <>
+ headerWith ("bar",[],[]) 1 "bar" <>
+ headerWith ("foo-2",[],[]) 2 "foo" <>
+ headerWith ("foo-3",[],[]) 1 "foo")
]
, testGroup "Directives"
[ "Title" =: