summaryrefslogtreecommitdiff
path: root/xt/test.pl
blob: 912f6ab2bd81dbcd48582c9160aaa3cb55e60436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#/usr/bin/perl

use ExtUtils::testlib;

use Text::Markdown 'markdown';
use Text::Markdown::Discount;
use Benchmark;
use File::Slurp;
use Text::Diff;

my $text = read_file('xt/index.text');
my $a = Text::Markdown::Discount::markdown($text);
my $b = Text::Markdown::markdown($text);

unless ( $a eq $b ) {
    print diff \$a, \$b; 
    #die "BOO";
}
my $count = 1000;
timethese($count, {
    'B_Text::Markdown::Discount' => sub { Text::Markdown::Discount::markdown($text) },
    'A_Text::Markdown' => sub { Text::Markdown::markdown($text) },
});