Debian Codegraph @

t/901-github-test-suite.t

raw
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 my %opt = (
12 # We are implementing the entire spec, except for the bugs below.
13 todo => [],
14 # These are bugs in the GitHub spec, not in our implementation. All
15 # of these have been tested to be buggy in the real cmark-gfm
16 # implementation.
17 bugs => [
18 # The spec says that some HTML tags are forbidden in the output,
19 # but it still has examples with these tags.
20 140 .. 142, 145, 147,
21 # Some things that are not cmark autolinks are matched by the
22 # extended autolinks syntax (but the cmark part of the spec is not
23 # updated for it).
24 616, 619, 620,
25 # The spec says that only http: and https: scheme can be used
26 # for extended autolinks. But this example uses ftp:.
27 628,
28 # While the spec says nothing of it, the cmark-gfm implementation
29 # removes a <strong> tag inside another strong tag (but not if there
30 # is another tag in between). For now we don’t implement this
31 # undocumented behavior.
32 398, 426, 434 .. 436, 473 .. 475, 477,
33 ],
34 json_file => "${FindBin::Bin}/data/github.tests.json",
35 test_url => 'https://github.github.com/gfm/#example-%d',
36 spec_tool => "${FindBin::Bin}/../third_party/commonmark-spec/test/spec_tests.py",
37 spec => "${FindBin::Bin}/../third_party/cmark-gfm/test/spec.txt",
38 spec_name => 'GitHub',
39 mode => 'github');
40
41 while ($_ = shift) {
42 $opt{test_num} = shift @ARGV if /^-n$/;
43 $opt{use_full_spec} = 0 if /^--fast/;
44 $opt{use_full_spec} = 1 if /^--full/;
45 }
46
47 test_suite(%opt);
48
49 done_testing;