CPAN-Meta-YAML

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

t/tml-local/perl-to-yaml/quoting.tml
t/tml-local/yaml-roundtrip/collection.tml
t/tml-local/yaml-roundtrip/comment.tml
t/tml-local/yaml-roundtrip/document.tml
t/tml-local/yaml-roundtrip/mapping.tml
t/tml-local/yaml-roundtrip/quoting.tml
t/tml-local/yaml-roundtrip/scalar.tml
t/tml-local/yaml-roundtrip/sequence.tml
t/tml-spec/basic-data.tml
t/tml-spec/multiline.tml
t/tml-spec/unicode.tml
t/tml-world/Acme-Time-Baby.tml
t/tml-world/Data-Swap.tml
t/tml-world/Games-Nintendo-Wii-Mii.tml
t/tml-world/HTML-WebDAO.tml
t/tml-world/ITS-SIN-FIDS-Content-XML.tml
t/tml-world/Plagger.tml
t/tml-world/Spreadsheet-Read.tml
t/tml-world/Template-Provider-Unicode-Japanese.tml
t/tml-world/Vanilla-Perl.tml
t/tml-world/YAML-Tiny-META.tml

t/30_yaml_spec_tml.t  view on Meta::CPAN


diag 'using JSON backend: ' . $JSON . ' ' . $JSON->VERSION
    if not $ENV{PERL_CORE};

# Each spec test will need a different bridge and arguments:
my @spec_tests = (
    ['t/tml-spec/basic-data.tml', 'test_yaml_json', $JSON],
    ['t/tml-spec/multiline.tml',  'test_yaml_json', $JSON],
    # This test is currently failing massively. We use LAST to only run what is
    # covered so far.
    ['t/tml-spec/unicode.tml', 'test_code_point'],  # uses JSON::PP
);

for my $test (@spec_tests) {
    my ($file, $bridge, @args) = @$test;
    my $code = sub {
        my ($file, $blocks) = @_;
        subtest "YAML Spec Test; file: $file" => sub {
            my $func = \&{$bridge};
            $func->($_) for @$blocks;
        };

t/tml  view on Meta::CPAN

#--------------------------------------------------------------------------#

# match path prefix under t/
my %BRIDGE_MAP = (
    'tml-local/dump-error'      => \&test_dump_error,
    'tml-local/load-error'      => \&test_load_error,
    'tml-local/load-warning'    => \&test_load_warning,
    'tml-local/perl-to-yaml'    => \&test_perl_to_yaml,
    'tml-local/yaml-roundtrip'  => \&test_yaml_roundtrip,
    'tml-spec/basic-data.tml'   => \&test_yaml_json,
    'tml-spec/unicode.tml'      => \&test_code_point,
    'tml-world'                 => \&test_yaml_roundtrip,
);

sub main {
    my ($verbose, $run_tests);
    GetOptions(
        'run_test' => \$run_tests,
    );

    if ( $run_tests ) {

t/tml  view on Meta::CPAN

corresponding test bridge functions.

Any arguments beginning with C<-> will be passed through to F<prove>.  All
other arguments will be used as patterns to select F<.tml> files found anywhere
under the F<t> directory.  You can use shell globbing syntax, and let the shell
expand the patterns, or you can quote/escape the patterns and let them be
treated as Perl regular expressions.

For example:

    t/tml unicode       # paths matching qr/unicode/
    t/tml basic uni     # paths matching qr/basic/ or qr/uni/
    t/tml 'local.*re'   # paths matching qr/local.*re/
    t/tml '\d+'         # paths matching qr/\d+/

Examples of options for prove:

    t/tml -v quoting    # verbose run of paths matching qr/quoting/
    t/tml -j9 world     # parallel run of paths matching qr/world/
    t/tml -j9           # parallel run of all .tml files

t/tml-spec/unicode.tml  view on Meta::CPAN

# Test unicode strings in key and value contexts

%TestML 0.1.0

###
# These tests target unicode characters that are handled special or known to be
# problematic. Test YNY (YAML→Native→YAML) and NYN roundtripping.
#
# YAML scalar emission does quoting based on first character, presence of
# escape characters, and special ambiguous cases like ': '. These ones
# character strings go a long way towards making sure an implementation is
# correct.
###


# Make a mapping { "$code" : "$code" } where code is a unicode code point:

# Dump mapping matches *yaml
*code.dump_code_key_value == *yaml

# Load *yaml then dump matches *yaml
*yaml.load_yaml.dump_yaml == *yaml

# Dump mapping the load memory-matches mapping
*code.code_key_value.dump_yaml.load_yaml === *code.code_key_value

t/tml-spec/unicode.tml  view on Meta::CPAN

# 160 (\xA0) → "non-breaking space"
# It seems extremely odd that YAML does not escape this.
# Investigate further.
=== Code point 160
--- SKIP
--- code: 160
--- yaml
 :  


# 161-… → From here on up use printable unicode chars.
# XXX Need to look into other special code blocks. Especially those known to
# libyaml.
=== Code point 161
--- code: 161
--- yaml
¡: ¡



( run in 0.464 second using v1.01-cache-2.11-cpan-88abd93f124 )