fletcher / peg-multimarkdown

An implementation of MultiMarkdown in C, using a PEG grammar - a fork of jgm's peg-markdown. No longer under active development - see MMD 5.
Other
525 stars 55 forks source link

Test failures on #a9a6e1f38a45ac51338d49e9094374d0b53b29b9, extra newline with <li> and newlines around <body> content #124

Closed goozbach closed 12 years ago

goozbach commented 12 years ago

Just cloned and compiled peg-multimarkdown and there were a couple of errors in the tests.

Either the test is wrong or the content isn't being generated properly.

$ make test
CC=gcc make -C peg
make[1]: Entering directory `/home/dcarter/projects/peg-multimarkdown/peg'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/dcarter/projects/peg-multimarkdown/peg'
cd MarkdownTest; \
./MarkdownTest.pl --Script=../multimarkdown --Tidy  --Flags="--compatibility"
Amps and angle encoding ... OK
Auto links ... OK
Backslash escapes ... OK
Blockquotes with code blocks ... OK
Code Blocks ... OK
Code Spans ... OK
Compatibility ... OK
Hard-wrapped paragraphs with list-like lines ... OK
Horizontal rules ... OK
Inline HTML (Advanced) ... OK
Inline HTML (Simple) ... OK
Inline HTML comments ... OK
Links, inline style ... OK
Links, reference style ... OK
Links, shortcut references ... OK
Literal quotes in titles ... OK
Markdown Documentation - Basics ... OK
Markdown Documentation - Syntax ... OK
Nested blockquotes ... OK
Ordered and unordered lists ... FAILED

138c138,139
< <li>Second:

---
> <li>
> <p>Second:</p>

Strong and em together ... OK
Tabs ... OK
Tidyness ... OK

22 passed; 1 failed.
Benchmark:  0 wallclock secs ( 0.01 usr  0.02 sys +  0.10 cusr  0.12 csys =  0.25 CPU)

As well as the mmd-tests (the email test is expected to fail according to the readme, but the others shouldn't)

CC=gcc make -C peg
make[1]: Entering directory `/home/dcarter/projects/peg-multimarkdown/peg'
make[1]: Nothing to be done for `all'.
make[1]: Leaving directory `/home/dcarter/projects/peg-multimarkdown/peg'
cd MarkdownTest; \
./MarkdownTest.pl --Script=../multimarkdown --testdir=MultiMarkdownTests
Automatic Labels ... FAILED

11d10
< 
41d39
< 

Base Header Level ... FAILED

12d11
< 
20d18
< 

BibTex ... 'MultiMarkdownTests/BibTex.html' does not exist.

Citations ... FAILED

13d12
< 
61d59
< 

Definition Lists ... FAILED

11d10
< 
55d53
< 

Dutch ... FAILED

11d10
< 
23d21
< 

Email ... FAILED

11,12c11
< 
< <p>Link: <a href="&#x6d;&#97;&#x69;&#x6c;&#x74;&#x6f;&#58;&#117;&#x73;&#x65;&#114;&#x36;&#55;&#x40;&#x65;&#120;&#97;&#109;&#112;&#108;&#x65;&#46;&#x63;&#x6f;&#109;">&#117;&#115;&#x65;&#x72;&#x36;&#x37;&#64;&#101;&#120;&#x61;&#x6d;&#x70;&#108;&#x65;&#46;&#x63;&#x6f;&#x6d;</a>.</p>

---
> <p>Link: <a href="&#x6d;&#x61;&#x69;&#108;&#116;&#111;&#58;&#117;&#x73;&#x65;&#114;&#x36;&#55;&#64;&#x65;&#x78;&#x61;&#x6d;&#112;&#108;&#x65;&#x2e;&#x63;&#x6f;&#109;">&#x75;&#x73;&#101;&#114;&#x36;&#x37;&#64;&#101;&#x78;&#97;&#x6d;&#x70;&#x6c;&#x65;&#x2e;&#x63;&#111;&#x6d;</a>.</p>
16c15
< <li><a href="&#x6d;&#97;&#x69;&#108;&#116;&#x6f;&#58;&#x75;&#115;&#x65;&#114;&#54;&#x37;&#64;&#101;&#120;&#x61;&#x6d;&#x70;&#108;&#x65;&#46;&#x63;&#111;&#x6d;">&#x75;&#x73;&#101;&#x72;&#54;&#x37;&#64;&#x65;&#120;&#97;&#x6d;&#112;&#x6c;&#101;&#46;&#99;&#111;&#109;</a></li>

---
> <li><a href="&#109;&#x61;&#x69;&#108;&#x74;&#111;&#x3a;&#x75;&#x73;&#101;&#114;&#54;&#55;&#64;&#101;&#120;&#x61;&#109;&#112;&#x6c;&#101;&#x2e;&#x63;&#x6f;&#109;">&#117;&#x73;&#101;&#x72;&#x36;&#x37;&#x40;&#101;&#x78;&#97;&#x6d;&#x70;&#x6c;&#101;&#x2e;&#x63;&#x6f;&#x6d;</a></li>
21c20
< <p>Blockquoted: <a href="&#x6d;&#x61;&#105;&#x6c;&#116;&#111;&#58;&#117;&#x73;&#101;&#114;&#54;&#55;&#x40;&#x65;&#120;&#97;&#109;&#x70;&#x6c;&#x65;&#46;&#x63;&#111;&#109;">&#117;&#x73;&#101;&#114;&#x36;&#x37;&#x40;&#101;&#x78;&#97;&#x6d;&#x70;&#x6c;&#x65;&#x2e;&#x63;&#x6f;&#x6d;</a></p>

---
> <p>Blockquoted: <a href="&#x6d;&#97;&#x69;&#108;&#116;&#x6f;&#x3a;&#117;&#115;&#101;&#114;&#x36;&#55;&#64;&#x65;&#x78;&#x61;&#109;&#x70;&#108;&#x65;&#x2e;&#99;&#111;&#x6d;">&#x75;&#x73;&#x65;&#x72;&#54;&#55;&#x40;&#101;&#120;&#97;&#x6d;&#112;&#108;&#x65;&#46;&#x63;&#111;&#109;</a></p>
31c30
< <p>Link: <a href="&#x6d;&#x61;&#105;&#x6c;&#x74;&#111;&#x3a;&#117;&#x73;&#x65;&#114;&#54;&#x37;&#64;&#x65;&#x78;&#x61;&#109;&#112;&#108;&#x65;&#46;&#x63;&#111;&#x6d;">&#117;&#x73;&#101;&#x72;&#x36;&#x37;&#x40;&#101;&#120;&#97;&#x6d;&#112;&#x6c;&#101;&#46;&#99;&#111;&#109;</a>.</p>

---
> <p>Link: <a href="&#109;&#97;&#x69;&#108;&#116;&#x6f;&#x3a;&#x75;&#115;&#x65;&#x72;&#54;&#x37;&#64;&#x65;&#120;&#97;&#109;&#x70;&#x6c;&#101;&#46;&#99;&#x6f;&#x6d;">&#117;&#x73;&#x65;&#114;&#x36;&#55;&#x40;&#101;&#x78;&#97;&#109;&#112;&#108;&#101;&#46;&#99;&#111;&#109;</a>.</p>
35c34
< <li><a href="&#x6d;&#97;&#x69;&#x6c;&#x74;&#x6f;&#x3a;&#117;&#115;&#x65;&#x72;&#54;&#x37;&#x40;&#101;&#x78;&#97;&#x6d;&#x70;&#x6c;&#x65;&#x2e;&#99;&#111;&#x6d;">&#x75;&#115;&#x65;&#114;&#54;&#x37;&#x40;&#x65;&#120;&#97;&#109;&#112;&#108;&#101;&#46;&#x63;&#x6f;&#x6d;</a></li>

---
> <li><a href="&#x6d;&#97;&#105;&#108;&#116;&#x6f;&#x3a;&#x75;&#x73;&#x65;&#114;&#x36;&#x37;&#x40;&#101;&#x78;&#x61;&#109;&#112;&#108;&#x65;&#x2e;&#x63;&#111;&#109;">&#x75;&#x73;&#101;&#114;&#x36;&#55;&#64;&#101;&#x78;&#x61;&#x6d;&#x70;&#x6c;&#x65;&#x2e;&#x63;&#111;&#109;</a></li>
40c39
< <p>Blockquoted: <a href="&#109;&#97;&#x69;&#108;&#x74;&#111;&#x3a;&#117;&#x73;&#101;&#114;&#x36;&#x37;&#64;&#101;&#x78;&#97;&#109;&#112;&#x6c;&#x65;&#x2e;&#99;&#111;&#x6d;">&#117;&#115;&#x65;&#x72;&#54;&#55;&#64;&#101;&#x78;&#97;&#x6d;&#x70;&#x6c;&#101;&#46;&#x63;&#111;&#109;</a></p>

---
> <p>Blockquoted: <a href="&#x6d;&#97;&#x69;&#x6c;&#x74;&#x6f;&#58;&#x75;&#115;&#x65;&#x72;&#54;&#x37;&#64;&#x65;&#120;&#97;&#109;&#112;&#x6c;&#x65;&#x2e;&#x63;&#x6f;&#x6d;">&#117;&#x73;&#x65;&#114;&#x36;&#55;&#64;&#101;&#x78;&#x61;&#109;&#112;&#108;&#x65;&#x2e;&#x63;&#x6f;&#x6d;</a></p>
47d45
< 

English ... FAILED

11d10
< 
23d21
< 

Errors ... FAILED

11d10
< 
16d14
< 

Footnotes ... FAILED

11d10
< 
45d43
< 

French ... FAILED

11d10
< 
23d21
< 

German ... FAILED

11d10
< 
23d21
< 

GermanGuillemets ... FAILED

11d10
< 
23d21
< 

Glossary ... FAILED

12d11
< 
45d43
< 

Headers ... FAILED

12d11
< 
48d46
< 

Line Breaks ... FAILED

11d10
< 
20d18
< 

Link Attributes ... FAILED

11d10
< 
54d52
< 

List Parsing ... FAILED

11d10
< 
20d18
< 

MarkdownInHTML ... FAILED

12d11
< 
19d17
< 

Math ... FAILED

12d11
< 
21d19
< 

MetaData ... FAILED

19d18
< 
21d19
< 

NotMetaData ... OK
Sanity ... FAILED

11d10
< 
103d101
< 

SmartQuotes ... FAILED

11d10
< 
29d27
< 

Swedish ... FAILED

11d10
< 
23d21
< 

Tables ... FAILED

13d12
< 
270d268
< 

1 passed; 24 failed.
Benchmark:  0 wallclock secs ( 0.01 usr  0.02 sys +  0.04 cusr  0.07 csys =  0.14 CPU)

Each of these failed tests is because of an additional blank line being inserted after the opening <body> and before the closing </body> tags. Again I'm not sure if the test or the generation is in the wrong here.

If these are both issues with the test suite being wrong I'll fork and update the tests, if not then I'm not sure where the change needs to be made.

Derek aka goozbach

fletcher commented 12 years ago

1st fail is known - see peg-markdown.

Others are as you said - emails don't obfuscate the same way on different OS types. Others are differences in blank lines between XSLT approach and non XSLT approach - those are unlikely to ever match exactly, but the differences are not meaningful