YAML-PP
view release on metacpan or search on metacpan
etc/generate-examples.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use FindBin '$Bin';
use lib "$Bin/../lib";
use YAML::PP;
my $tests_perl = require "$Bin/../examples/schema-perl.pm";
my $tests_ixhash = require "$Bin/../examples/schema-ixhash.pm";
my $schema_perl_pm_file = "$Bin/../lib/YAML/PP/Schema/Perl.pm";
my $schema_ixhash_pm_file = "$Bin/../lib/YAML/PP/Schema/Tie/IxHash.pm";
my $yp = YAML::PP->new( schema => [qw/ JSON Perl Tie::IxHash /] );
generate(
file => $schema_perl_pm_file,
tests => $tests_perl,
);
examples/schemas.pl view on Meta::CPAN
#!/usr/bin/env perl
use strict;
use warnings;
use FindBin '$Bin';
use lib "$Bin/../lib";
use YAML::PP;
my $tests_perl = require "$Bin/schema-perl.pm";
my $tests_ixhash = require "$Bin/schema-ixhash.pm";
my %tests = (
%$tests_perl,
%$tests_ixhash,
);
my %all_data;
for my $name (sort keys %tests) {
my $test = $tests{ $name };
my $data = eval $test->[0];
t/37.schema-perl.t view on Meta::CPAN
eval "use Test::Deep qw/ cmp_deeply /";
unless ($@) {
$test_deep = 1;
}
}
unless ($test_deep) {
plan skip_all => "No Test::Deep available";
exit;
}
my $tests = require "$Bin/../examples/schema-perl.pm";
my $perl_no_objects = YAML::PP::Schema::Perl->new(
classes => [],
cyclic_refs => 'allow',
);
my $perl_no_objects_loadcode = YAML::PP::Schema::Perl->new(
classes => [],
loadcode => 1,
cyclic_refs => 'allow',
);
t/38.schema-ixhash.t view on Meta::CPAN
use Test::More;
use FindBin '$Bin';
use Data::Dumper;
use YAML::PP;
my $ixhash = eval { require Tie::IxHash };
unless ($ixhash) {
plan skip_all => "Tie::IxHash not installed";
exit;
}
my $tests = require "$Bin/../examples/schema-ixhash.pm";
my $yp = YAML::PP->new(
schema => [qw/ JSON Perl Tie::IxHash /],
);
my @tests = sort keys %$tests;
for my $name (@tests) {
my $test = $tests->{ $name };
my ($code, $yaml) = @$test;
my $data = eval $code;
( run in 0.377 second using v1.01-cache-2.11-cpan-05444aca049 )