From a237a8aeec826888cabdd033aef34dbfa587acce Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Mon, 5 Jun 2006 21:28:53 +0000 Subject: [PATCH] More section extraction tests: trailing comments, starting comments (bug 2587), invalid trailing text --- maintenance/parserTests.txt | 116 ++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index d2070d739e..1d33b2dcdb 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -4663,6 +4663,122 @@ start ===ca=== !! end +!! test +Section extraction test (nonexistent section 11) +!! options +section=11 +!! input +start +==a== +===aa=== +====aaa==== +==b== +===ba=== +===bb=== +====bba==== +===bc=== +==c== +===ca=== +!! result +!! end + +!! test +Section extraction test with bogus heading (section 1) +!! options +section=1 +!! input +==a== +==bogus== not a legal section +==b== +!! result +==a== +==bogus== not a legal section +!! end + +!! test +Section extraction test with bogus heading (section 2) +!! options +section=2 +!! input +==a== +==bogus== not a legal section +==b== +!! result +==b== +!! end + +!! test +Section extraction test with comment after heading (section 1) +!! options +section=1 +!! input +==a== +==legal== +==b== +!! result +==a== +!! end + +!! test +Section extraction test with comment after heading (section 2) +!! options +section=2 +!! input +==a== +==legal== +==b== +!! result +==legal== +!! end + +!! test +Section extraction test with bogus heading (section 1) +!! options +section=1 +!! input +==a== +==bogus== not a legal section +==b== +!! result +==a== +==bogus== not a legal section +!! end + +!! test +Section extraction test with bogus heading (section 2) +!! options +section=2 +!! input +==a== +==bogus== not a legal section +==b== +!! result +==b== +!! end + + +!! test +Section extraction prefixed by comment (section 1) (bug 2587) +!! options +section=1 +!! input +==sec1== +==sec2== +!!result +==sec1== +!!end + +!! test +Section extraction prefixed by comment (section 2) (bug 2587) +!! options +section=2 +!! input +==sec1== +==sec2== +!!result +==sec2== +!!end + # # -- 2.20.1