Test::More::Unlike - show the matched position
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.
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
# This is OK. use Test::More; use Test::More::Unlike;
Test::More::Unlike is hosted on github <http://github.com/bayashi/Test-More-Unlike>
Welcome your patches and issues :D
Dai Okabayashi <email@example.com>
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.