Debian Codegraph @

t/zzz-acceptance-draft2019-09.t

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