Debian Codegraph @

t/99-sanity.t

raw
1 # vim: set ts=8 sts=2 sw=2 tw=100 et :
2 use strict;
3 use warnings;
4 use strictures 2;
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
14 use Test2::V0 -no_pragmas => 1;
15 use if $ENV{AUTHOR_TESTING}, 'Test2::Warnings';
16 use Test::File::ShareDir -share => { -dist => { 'Test-JSON-Schema-Acceptance' => 'share' } };
17 use File::ShareDir 'dist_dir';
18 use Path::Tiny;
19 use Test2::Tools::Exception;
20 use Test::JSON::Schema::Acceptance;
21
22 foreach my $draft (path(dist_dir('Test-JSON-Schema-Acceptance'), 'tests')->children) {
23 $draft = $draft->basename;
24 next if $draft eq 'draft-next';
25 my $accepter = Test::JSON::Schema::Acceptance->new(specification => $draft, include_optional => 1);
26 ok(
27 lives { $accepter->_test_data },
28 'test data for '.$draft.' does not violate any type constraints',
29 );
30 }
31
32 done_testing;