| 1 |
# Run the appropriate tests from https://github.com/ingydotnet/yaml-spec-tml |
| 2 |
use strict; |
| 3 |
use warnings; |
| 4 |
use lib 't/lib'; |
| 5 |
use Test::More 0.88; |
| 6 |
use SubtestCompat; |
| 7 |
use TestBridge; |
| 8 |
use TestUtils; |
| 9 |
|
| 10 |
my $JSON = json_class() |
| 11 |
or Test::More::plan skip_all => 'no JSON backends available!?'; |
| 12 |
|
| 13 |
diag 'using JSON backend: ' . $JSON . ' ' . $JSON->VERSION |
| 14 |
if not $ENV{PERL_CORE}; |
| 15 |
|
| 16 |
# Each spec test will need a different bridge and arguments: |
| 17 |
my @spec_tests = ( |
| 18 |
['t/tml-spec/basic-data.tml', 'test_yaml_json', $JSON], |
| 19 |
# This test is currently failing massively. We use LAST to only run what is |
| 20 |
# covered so far. |
| 21 |
['t/tml-spec/unicode.tml', 'test_code_point'], # uses JSON::PP |
| 22 |
); |
| 23 |
|
| 24 |
for my $test (@spec_tests) { |
| 25 |
my ($file, $bridge, @args) = @$test; |
| 26 |
my $code = sub { |
| 27 |
my ($file, $blocks) = @_; |
| 28 |
subtest "YAML Spec Test; file: $file" => sub { |
| 29 |
my $func = \&{$bridge}; |
| 30 |
$func->($_) for @$blocks; |
| 31 |
}; |
| 32 |
}; |
| 33 |
run_testml_file($file, $code, @args); |
| 34 |
} |
| 35 |
|
| 36 |
done_testing; |