Debian Codegraph @

t/additional-tests-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 lib 't/lib';
16 use Helper;
17 use Acceptance;
18 use Test2::Warnings 'warnings', ':no_end_test';
19
20 my $version = 'draft2020-12';
21
22 my @warnings = warnings {
23 acceptance_tests(
24 acceptance => {
25 specification => $version,
26 test_dir => 't/additional-tests-'.$version,
27 },
28 evaluator => {
29 specification_version => $version,
30 validate_formats => 1,
31 collect_annotations => 0,
32 },
33 output_file => $version.'-additional-tests.txt',
34 test => {
35 $ENV{NO_TODO} ? () : (todo_tests => [
36 { file => [
37 # these all depend on optional prereqs
38 !eval { require Data::Validate::Domain; Data::Validate::Domain->VERSION('0.13'); 1 } ? 'format-hostname.json' : (),
39 ] },
40 # various edge cases that are difficult to accomodate
41 JSON::Schema::Modern::_JSON_BACKEND eq 'JSON::PP' ? { file => 'integers.json', group_description => 'int64 range checks', test_description => 'beyond lower boundary' } : (),
42 ]),
43 },
44 );
45 };
46
47 my $test_sub = $ENV{AUTHOR_TESTING} ? sub { bag(@_) } : sub { superbagof(@_) };
48
49 cmp_result(
50 \@warnings,
51 $test_sub->(
52 # these are all in unknownKeyword.json
53 map +(
54 (re(qr/^no-longer-supported "\Q$_\E" keyword present/)) x (4 * ($ENV{NO_SHORT_CIRCUIT} ? 1 : 2)),
55 ), qw(dependencies id additionalItems $recursiveAnchor $recursiveRef),
56 ),
57 'got unsupported keyword warnings'.($ENV{AUTHOR_TESTING} ? '; no unexpected warnings' : ''),
58 );
59
60 done_testing;
61 __END__
62 see t/results/draft2020-12-additional-tests.txt for test results