Text::Markdown vs MDTest (Was: Re: forking Markdown.pl?)

Tomas Doran bobtfish at bobtfish.net
Sat Mar 22 08:49:50 EDT 2008



On 22 Mar 2008, at 02:32, Michel Fortin wrote:


> Le 2008-03-21 à 16:39, Tomas Doran a écrit :

>

>> So, the *only* things that Text::Markdown currently fails on are

>> small whitespace changes..

>

> Hum, have you written your own test script?


Yep.

Actually, I'd already written one - I can just 'require' it, and call
the 'test everything in this directory' function ;)


> I encourage you to use the mdtest.php script if you have PHP 5

> installed on your computer. It'll normalize the whitespace for you

> before comparing the output, ensuring that insignificant whitespace

> differences don't make any test fail. All you need is an executable

> you can invoke that will parse the standard input and put the

> result on the standard output and you can use MDTest like this:

>

> ./mdtest.php -n -s Markdown.pl

>

> -n for normalize (and ignore insignificant whitespace), -s to tell

> mdtest to use the given script (such as Markdown.pl). You can add -

> d to see a diff for failing tests.

>


The problem with that is that it's pretty hard to require that
everyone installing (the perl version of) Markdown has php5 installed...

Obviously, I can make this optional (and you can only run these tests
if you have php5), however that would make the CPAN smoke testing I
get a whole helluva lot less effective..

The other issue is that as mdtest.php doesn't output TAP test format,
then it's not possible to use it in standard perl TAP tests - however
this is easily overcome by providing a wrapper.

So, my approximate plan is:
1) Re-write your whitespace normalisation stuff (or see if I can
convince something on CPAN already to do it), for my test suite so
that getting a real smoke test against MDTest doesn't require php.
2) Write a wrapper for mdtest.php to convert it's output into TAP
format so that it can/will be run as part of my test suite if php5 is
available. (Or, I can write php - would you take a patch to output
TAP format as an option so that I don't have to re-parse your output?)
3) Compare all of my tests to see which I'd like to add to MDTest.
4) Fix the bugs left in Text::Markdown which the PHP Markdown test
suite shows up ;)

Cheers
Tom



More information about the Markdown-Discuss mailing list