Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by mauzo (8185) on 2007.12.04 12:09 (#59299)
    I don't know if you've got anywhere with this yet, but a minimal example that breaks is

    $ diff -u t/03_yaml.t{.orig,}
    --- t/03_yaml.t.orig    Tue Dec  4 17:03:08 2007
    +++ t/03_yaml.t Tue Dec  4 17:03:29 2007
    @@ -11,7 +11,8 @@

    # Test YAML support
    SKIP: {
    -       skip( "TERMCAP currently breaks YAML::Tiny", 6 ) if $ENV{TERMCAP};
    +       #skip( "TERMCAP currently breaks YAML::Tiny", 6 ) if $ENV{TERMCAP};
    +        $ENV{TERMCAP} = "foo\\\n\tbar";

            my $cgi = CGI::Capture->new;
            isa_ok( $cgi, 'CGI::Capture' );
    $ perl -Mblib t/03_yaml.t
    1..6
    ok 1 - The object isa CGI::Capture
    ok 2 - ->capture ok
    ok 3 - The object isa YAML::Tiny
    not ok 4 - YAML object round-trips ok
    #   Failed test 'YAML object round-trips ok'
    #   at t/03_yaml.t line 26.
    #     Structures begin differing at:
    #          $got->[0]{ENV}{TERMCAP} = 'foo\
    #       bar'
    #     $expected->[0]{ENV}{TERMCAP} = 'foo\
    #     REF(0x83128f4)bar'
    ok 5 - ->as_yaml returns a YAML document
    not ok 6 - CGI::Capture round-trips ok
    #   Failed test 'CGI::Capture round-trips ok'
    #   at t/03_yaml.t line 34.
    #     Structures begin differing at:
    #          $got->{ENV}{TERMCAP} = 'foo\
    #       bar'
    #     $expected->{ENV}{TERMCAP} = 'foo\
    #     REF(0x832acf0)bar'
    # Looks like you failed 2 tests of 6.

    For some reason YAML::Tiny chokes on the "\\\n\t" sequence, and thinks it should be a ref. Large TERMCAPs tend to be whole termcap entries (screen is a common culprit here: it insists on putting the whole entry in the environment) which always contain that sequence.