2017 © Pedro Peláez
 

library markdown-testsuite

A markdown test suite

image

kzykhys/markdown-testsuite

A markdown test suite

  • Saturday, February 15, 2014
  • by kzykhys
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 24 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

markdown-testsuite

Latest Stable Version Latest Unstable Version, (*1)

After starting the W3C Community Group about Markdown, a question has been raised a few times about a test suite for the markdown syntax., (*2)

I decided to put together a list of individual files isolating some constructs of the markdown syntax. Some features might be missing, you know the deal. Pull Requests are welcome., (*3)

Modification by @kzykhys

Helper class for PHP

``` php <?php, (*4)

class MarkdownTest extends PHPUnit_Framework_TestCase { public function testParser() { $parser = new YourParser();, (*5)

    // test suite based on karlcow/markdown-testsuite
    $tests = new KzykHys\MarkdownTestSuite\Tests();

    foreach ($tests as $pattern) {
        $this->assertEquals(
            $pattern->getOutput(),                   // expected
            $parser->parse($pattern->getMarkdown()), // actual
            $pattern->getName() . ' failed'          // message
        );
    }
}

public function testYourPatterns()
{
    $parser = new YourParser();

    // {name}.md for input and {name}.out for output
    $tests = new KzykHys\MarkdownTestSuite\Tests('/path/to/patterns');

    foreach ($tests as $pattern) {
        $this->assertEquals(
            $pattern->getOutput(),                   // expected
            $parser->parse($pattern->getMarkdown()), // actual
            $pattern->getName() . ' failed'          // message
        );
    }
}

}, (*6)


composer.json example ``` json { "require-dev": { "kzykhys/markdown-testsuite": "dev-master" } }

The Versions

15/02 2014

dev-master

9999999-dev

A markdown test suite

  Sources   Download

MIT

The Requires

 

by Kazuyuki Hayashi
by Karl Dubost

test markdown suite