The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Test::More::Unlike - show the matched position

SYNOPSIS

    use Test::More tests => 1;
    use Test::More::Unlike;
    
    unlike 'abcdef', qr/cd/;
    
    #    not ok 1
    #    #   Failed test at t/01_basic.t line 6.
    #    #                   'abcdef'
    #    #           matches '(?-xism:cd)'
    #    #           matched at line: 1, offset: 3
    #    # Looks like you failed 1 test of 1.

DESCRIPTION

When unlike test fails, if you have used Test::More::Unlike, then the error diag shows additionally the matched position like below.

    #           matched at line: 1, offset: 3

NOTE that it is only first matched position. And offset count is calculated as octet.

NOTE that below code does NOT work as expected(It works, but Not show a count of line and offset).

    use Test::More::Unlike;
    use Test::More;
    
    unlike 'abcdef', qr/cd/;
    
    done_testing;

Test::More should be loaded before Test::More::Unlike.

    # This is OK.
    use Test::More;
    use Test::More::Unlike;

REPOSITORY

Test::More::Unlike is hosted on github <http://github.com/bayashi/Test-More-Unlike>

Welcome your patches and issues :D

AUTHOR

Dai Okabayashi <bayashi@cpan.org>

SEE ALSO

Test::More

LICENSE

This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.