2015-01-10 20:45:29 -08:00
|
|
|
#!/usr/bin/env perl
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
2015-01-11 18:36:19 -08:00
|
|
|
|
2015-01-10 20:45:29 -08:00
|
|
|
use Test::More;
|
|
|
|
use DDG::Test::Goodie;
|
|
|
|
|
2015-01-11 18:36:19 -08:00
|
|
|
zci answer_type => 'markdown_cheat';
|
2015-01-10 20:45:29 -08:00
|
|
|
zci is_cached => 1;
|
|
|
|
|
2015-01-11 18:36:19 -08:00
|
|
|
sub test_success {
|
|
|
|
return test_zci(
|
2015-01-12 15:10:54 -08:00
|
|
|
qr/^$_[0]/s,
|
2015-01-11 18:36:19 -08:00
|
|
|
heading => 'Markdown Cheat Sheet',
|
2015-01-27 06:45:50 -08:00
|
|
|
html => qr/Markdown:<pre>$_[0].*<\/pre>HTML:<pre><$_[1] ?.*>.*<\/pre>/s,
|
2015-01-11 18:36:19 -08:00
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2015-01-10 20:45:29 -08:00
|
|
|
ddg_goodie_test(
|
2015-01-11 18:36:19 -08:00
|
|
|
[ 'DDG::Goodie::MarkdownCheatSheet' ],
|
2015-01-15 11:40:30 -08:00
|
|
|
'md header' => test_success('#', 'h1'),
|
|
|
|
'markdown header' => test_success('#', 'h1'),
|
2015-01-12 15:10:54 -08:00
|
|
|
'markdown cheat sheet header' => test_success('#', 'h1'),
|
2015-01-15 11:40:30 -08:00
|
|
|
'md cheat sheet header' => test_success('#', 'h1'),
|
2015-01-13 08:44:13 -08:00
|
|
|
'h1 markdown cheat sheet' => test_success('#', 'h1'),
|
2015-01-12 15:10:54 -08:00
|
|
|
'markdown help h1' => test_success('#', 'h1'),
|
|
|
|
'markdown syntax list' => test_success('-', 'ul'),
|
|
|
|
'markdown quick reference em' => test_success('_', 'em'),
|
|
|
|
'markdown guide strong' => test_success('\*\*', 'strong'),
|
|
|
|
'markdown reference blockquote' => test_success('>', 'blockquote'),
|
|
|
|
'markdown cheatsheet insert image' => test_success('!', 'img'),
|
|
|
|
'markdown cheat sheet link' => test_success('\[', 'a'),
|
2015-01-11 18:36:19 -08:00
|
|
|
'markdown cheat sheet random stuff' => undef,
|
2015-01-10 20:45:29 -08:00
|
|
|
);
|
|
|
|
|
|
|
|
done_testing;
|