Debian Codegraph @

t/additional-tests-draft7.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 = 'draft7';
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 # various edge cases that are difficult to accomodate
37 JSON::Schema::Modern::_JSON_BACKEND eq 'JSON::PP' ? { file => 'integers.json', group_description => 'int64 range checks', test_description => 'beyond lower boundary' } : (),
38 ]),
39 },
40 );
41 };
42
43 my $test_sub = $ENV{AUTHOR_TESTING} ? sub { bag(@_) } : sub { superbagof(@_) };
44
45 cmp_result(
46 \@warnings,
47 $test_sub->(
48 # these are all in unknownKeyword.json
49 map +(
50 (re(qr/^no-longer-supported "$_" keyword present/)) x (4 * ($ENV{NO_SHORT_CIRCUIT} ? 1 : 2)),
51 ), qw(id),
52 ),
53 'got unsupported keyword warnings'.($ENV{AUTHOR_TESTING} ? '; no unexpected warnings' : ''),
54 );
55
56 done_testing;
57 __END__
58 see t/results/draft7-additional-tests.txt for test results