use strict; use warnings; use Test::More tests => 7; use Test::Exception; use_ok( 'Text::Markdown', 'markdown' ); my $instr = q{A trivial block of text}; my $outstr = q{

A trivial block of text

}; lives_ok { $outstr = markdown($instr); } 'Functional markdown works without an exception'; chomp($outstr); is( $outstr => '

' . $instr . '

', 'exported markdown function works' ); # Test that we *force* multimarkdown features to be off $instr = q{# Heading 1}; my $expstr = qq{

Heading 1

\n}; lives_ok { $outstr = markdown($instr, { heading_ids => 1}); } 'Functional markdown works without an exception, with options'; is( $outstr => $expstr, 'exported markdown function overrides passed options' ); { local $TODO = 'Broken here'; $outstr = ''; lives_ok { $outstr = Text::Markdown->markdown($instr); } 'Lives (class method)'; chomp($outstr); is($outstr, '

' . $instr . '

', 'Text::Markdown->markdown() works (as class method)'); };