| 1 |
use strict; |
| 2 |
use warnings; |
| 3 |
use utf8; |
| 4 |
|
| 5 |
use FindBin; |
| 6 |
use lib "${FindBin::Bin}/lib"; |
| 7 |
|
| 8 |
use CmarkTest; |
| 9 |
use Test2::V0; |
| 10 |
|
| 11 |
# As of writing, the spec seems more up to date in the commonmark-spec repo than |
| 12 |
# in the cmark repo, although the cmark one has other tools too. |
| 13 |
my %opt = (json_file => "${FindBin::Bin}/data/cmark.tests.json", |
| 14 |
test_url => 'https://spec.commonmark.org/0.31.2/#example-%d', |
| 15 |
spec_tool => "${FindBin::Bin}/../third_party/commonmark-spec/test/spec_tests.py", |
| 16 |
spec => "${FindBin::Bin}/../third_party/commonmark-spec/spec.txt", |
| 17 |
spec_name => 'CommonMark', |
| 18 |
mode => 'cmark'); |
| 19 |
|
| 20 |
while ($_ = shift) { |
| 21 |
$opt{test_num} = shift @ARGV if /^-n$/; |
| 22 |
$opt{use_full_spec} = 0 if /^--fast/; |
| 23 |
$opt{use_full_spec} = 1 if /^--full/; |
| 24 |
} |
| 25 |
|
| 26 |
test_suite(%opt); |
| 27 |
|
| 28 |
done_testing; |