File: 1-basic.t

package info (click to toggle)
libyaml-syck-perl 1.20-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 932 kB
  • sloc: ansic: 3,987; perl: 3,387; makefile: 4
file content (42 lines) | stat: -rw-r--r-- 1,021 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
use strict;
use warnings;
use Test::More tests => 11;

use YAML::Syck;

ok(YAML::Syck->VERSION);
is(Dump("Hello, world"), "--- Hello, world\n");
is(Load("--- Hello, world\n"), "Hello, world");

TODO: {
    local $TODO = 'RT 34073 - Parsing YAML without separator';
    my $out = eval {Load("--\n")};
    isnt($@, '', "Bad data dies on Load");
    is($out, undef, "Bad data fails load");
}


TODO: {
    my $out = eval {Load("")};
    is($out, undef, "Bad data fails load");

    local $TODO = 'Load fails on empty string';
    isnt($@, '', "Bad data dies on Load");
}


TODO: {
    my $out = eval {Load("feefifofum\n\n\ndkjdkdk")};

    local $TODO = 'Load fails on empty string';
    isnt($@, '', "Bad data dies on Load");
    is($out, undef, "Bad data fails load");
}

TODO: {
    my $out = eval {Load("---\n- ! >-\n")};

    local $TODO = 'RT 23850 - META.yml of DMAKI/DateTime-Format-Japanese-0.01.tar.gz cannot be parsed';
    is($@, '', "Bad data dies on Load");
    is_deeply($out, [''], "Bad data fails load");
}