Debian Codegraph @

t/zzz-acceptance-draft2020-12.t

raw
1 # vim: set ft=perl ts=8 sts=2 sw=2 tw=100 et :
2 use strictures 2;
3 use 5.020;
4 use stable 0.031 'postderef';
5 use experimental 'signatures';
6 no autovivification warn => qw(fetch store exists delete);
7 use if "$]" >= 5.022, experimental => 're_strict';
8 no if "$]" >= 5.031009, feature => 'indirect';
9 no if "$]" >= 5.033001, feature => 'multidimensional';
10 no if "$]" >= 5.033006, feature => 'bareword_filehandles';
11 no if "$]" >= 5.041009, feature => 'smartmatch';
12 no feature 'switch';
13 use open ':std', ':encoding(UTF-8)'; # force stdin, stdout, stderr into utf8
14
15 use List::Util 1.50 'head';
16 use Config;
17 use lib 't/lib';
18 use Helper;
19 use Acceptance;
20
21 BEGIN {
22 my @variables = qw(AUTHOR_TESTING AUTOMATED_TESTING EXTENDED_TESTING);
23
24 plan skip_all => 'These tests may fail if the test suite continues to evolve! They should only be run with '
25 .join(', ', map $_.'=1', head(-1, @variables)).' or '.$variables[-1].'=1'
26 if not grep $ENV{$_}, @variables;
27 }
28
29 my $version = 'draft2020-12';
30
31 my $orig_warn_handler = $SIG{__WARN__};
32 $SIG{__WARN__} = sub {
33 return if $_[0] =~ /^no-longer-supported "dependencies" keyword present \(at location ""\): this should be rewritten as "dependentSchemas" or "dependentRequired"/;
34 goto &$orig_warn_handler if $orig_warn_handler;
35 };
36
37 acceptance_tests(
38 acceptance => {
39 specification => $version,
40 skip_dir => 'optional/format',
41 },
42 evaluator => {
43 specification_version => $version,
44 # validate_formats behaviour should default to false for this draft
45 collect_annotations => 0,
46 },
47 output_file => $version.'-acceptance.txt',
48 test => {
49 skip_tests => [
50 # I am not interested in back-supporting "dependencies"
51 { file => 'optional/dependencies-compatibility.json' },
52 # spec-violating things we will never do
53 { file => 'optional/refOfUnknownKeyword.json' },
54 ],
55 $ENV{NO_TODO} ? () : (todo_tests => [
56 # various edge cases that are difficult to accomodate
57 $Config{ivsize} < 8 ? { file => 'multipleOf.json', group_description => 'small multiple of large integer', test_description => 'any integer is a multiple of 1e-8' } : (),
58 { file => 'optional/ecmascript-regex.json', group_description => '\w in patterns matches [A-Za-z0-9_], not unicode letters', test_description => [ 'literal unicode character in json string', 'unicode character in hex format in string' ] },
59 { file => 'optional/ecmascript-regex.json', group_description => '\d in pattern matches [0-9], not unicode digits', test_description => 'non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)' },
60 { file => 'optional/ecmascript-regex.json', group_description => '\w in patternProperties matches [A-Za-z0-9_], not unicode letters', test_description => [ 'literal unicode character in json string', 'unicode character in hex format in string' ] },
61 { file => 'optional/ecmascript-regex.json', group_description => '\d in patternProperties matches [0-9], not unicode digits', test_description => 'non-ascii digits (BENGALI DIGIT FOUR, BENGALI DIGIT TWO)' },
62 { file => 'optional/ecmascript-regex.json', group_description => [ 'ECMA 262 \d matches ascii digits only', 'ECMA 262 \D matches everything but ascii digits', 'ECMA 262 \w matches ascii letters only', 'ECMA 262 \W matches everything but ascii letters' ] }, # TODO, see test suite PR#505
63 { file => 'optional/ecmascript-regex.json', group_description => 'ECMA 262 \s matches whitespace', test_description => 'zero-width whitespace matches' },
64 { file => 'optional/ecmascript-regex.json', group_description => 'ECMA 262 \S matches everything but whitespace', test_description => 'zero-width whitespace does not match' },
65 ]),
66 },
67 );
68
69 END {
70 diag <<DIAG
71
72 ###############################
73
74 Attention CPANTesters: you do not need to file a ticket when this test fails. I will receive the test reports and act on it soon. thank you!
75
76 ###############################
77 DIAG
78 if not is_passing;
79 }
80
81 done_testing;
82 __END__
83 see t/results/draft2020-12-acceptance.txt for test results