Can someone tell me why this test fails?

    #!/usr/bin/perl -l

    use strict;
    use warnings;
    use Test::More 'no_plan';
    use Test::Differences;

    use Data::Dumper;
    my @data = qw(foo bar);
    ok my $data = pack('u', @data), 'packing data should succeed';
    ok my @new_data = unpack('u', $data), '... and unpacking it should 
succeed';    eq_or_diff [EMAIL PROTECTED], [EMAIL PROTECTED],
        '... and it should survive the round-trip';

With this output:

    ok 1 - packing data should succeed
    ok 2 - ... and unpacking it should succeed
    not ok 3 - ... and it should survive the round-trip
    #   Failed test '... and it should survive the round-trip'
    #   in test.pl at line 12.
    # +----+-----+----+----------+
    # | Elt|Got  | Elt|Expected  |
    # +----+-----+----+----------+
    # |   0|foo  |   0|foo       |
    # |    |     *   1|bar       *
    # +----+-----+----+----------+
    1..3
    # Looks like you failed 1 test of 3. 


Cheers,
Ovid

-- 
Buy the book -- http://www.oreilly.com/catalog/perlhks/
Perl and CGI -- http://users.easystreet.com/ovid/cgi_course/



Reply via email to