Debian Codegraph @

xt/author/live-data-sanity.t

raw
1 # vim: set ft=perl ts=8 sts=2 sw=2 tw=100 et :
2 use strict;
3 use warnings;
4 use 5.020;
5 use strictures 2;
6 use stable 0.031 'postderef';
7 use experimental 'signatures';
8 no autovivification warn => qw(fetch store exists delete);
9 use if "$]" >= 5.022, experimental => 're_strict';
10 no if "$]" >= 5.031009, feature => 'indirect';
11 no if "$]" >= 5.033001, feature => 'multidimensional';
12 no if "$]" >= 5.033006, feature => 'bareword_filehandles';
13 no if "$]" >= 5.041009, feature => 'smartmatch';
14
15 use Test2::V0 -no_pragmas => 1;
16 use Test2::Warnings;
17 use Feature::Compat::Try;
18 use Path::Tiny;
19 use Test::File::ShareDir -share => { -dist => { 'Test-JSON-Schema-Acceptance' => 'share' } };
20 use Test::JSON::Schema::Acceptance;
21
22 my $test_dir = path(File::ShareDir::dist_dir('Test-JSON-Schema-Acceptance'), 'tests');
23
24 foreach my $draft (sort $test_dir->children) {
25 $draft = $draft->basename;
26 next if $draft eq 'draft-next';
27 my $accepter = Test::JSON::Schema::Acceptance->new(specification => $draft);
28 my $exception;
29 try {
30 $accepter->_test_data;
31 }
32 catch ($e) {
33 $exception = $e;
34 };
35
36 is($exception, undef, 'no errors loading data for '.$draft);
37 }
38
39 done_testing;