From 02e68859ebe964002b42d76ecbd3eea51a3e1f33 Mon Sep 17 00:00:00 2001 From: Alexander Krotov Date: Sun, 2 Sep 2018 17:26:43 +0300 Subject: 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. --- test/Tests/Readers/Muse.hs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'test/Tests') 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" =: -- cgit v1.2.3