r68149 - in /trunk/libtest-longstring-perl: Changes META.yml README debian/changelog debian/control debian/copyright debian/patches/ debian/patches/fix-spelling-error debian/patches/series lib/Test/LongString.pm t/01teststring.t t/02import.t t/05lacks.t
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Tue Feb 8 09:19:00 UTC 2011
Author: angelabad-guest
Date: Tue Feb 8 09:18:13 2011
New Revision: 68149
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=68149
Log:
* New upstream release
* debian/copyright:
- Update license stanzas
- Update copyright years
* debian/patches/fix-spelling-error:
- New patch to fix spelling error in manpage
Added:
trunk/libtest-longstring-perl/debian/patches/
trunk/libtest-longstring-perl/debian/patches/fix-spelling-error
trunk/libtest-longstring-perl/debian/patches/series
Modified:
trunk/libtest-longstring-perl/Changes
trunk/libtest-longstring-perl/META.yml
trunk/libtest-longstring-perl/README
trunk/libtest-longstring-perl/debian/changelog
trunk/libtest-longstring-perl/debian/control
trunk/libtest-longstring-perl/debian/copyright
trunk/libtest-longstring-perl/lib/Test/LongString.pm
trunk/libtest-longstring-perl/t/01teststring.t
trunk/libtest-longstring-perl/t/02import.t
trunk/libtest-longstring-perl/t/05lacks.t
Modified: trunk/libtest-longstring-perl/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-longstring-perl/Changes?rev=68149&op=diff
==============================================================================
--- trunk/libtest-longstring-perl/Changes (original)
+++ trunk/libtest-longstring-perl/Changes Tue Feb 8 09:18:13 2011
@@ -21,3 +21,6 @@
0.14
Compatibility fix with perl 5.13.5
+
+0.15
+ Show line and column number in diagostics (Mark Fowler)
Modified: trunk/libtest-longstring-perl/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-longstring-perl/META.yml?rev=68149&op=diff
==============================================================================
--- trunk/libtest-longstring-perl/META.yml (original)
+++ trunk/libtest-longstring-perl/META.yml Tue Feb 8 09:18:13 2011
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Test-LongString
-version: 0.14
+version: 0.15
abstract: ~
author:
- Rafael Garcia-Suarez <rgs at consttype.org>
@@ -17,7 +17,7 @@
directory:
- t
- inc
-generated_by: ExtUtils::MakeMaker version 6.56
+generated_by: ExtUtils::MakeMaker version 6.55_02
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
Modified: trunk/libtest-longstring-perl/README
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-longstring-perl/README?rev=68149&op=diff
==============================================================================
--- trunk/libtest-longstring-perl/README (original)
+++ trunk/libtest-longstring-perl/README Tue Feb 8 09:18:13 2011
@@ -1,4 +1,4 @@
-Test::LongString v0.14
+Test::LongString v0.15
======================
A library to test long strings.
@@ -22,4 +22,4 @@
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
-Copyright (c) 2002 - 2010 Rafael Garcia-Suarez
+Copyright (c) 2002 - 2011 Rafael Garcia-Suarez
Modified: trunk/libtest-longstring-perl/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-longstring-perl/debian/changelog?rev=68149&op=diff
==============================================================================
--- trunk/libtest-longstring-perl/debian/changelog (original)
+++ trunk/libtest-longstring-perl/debian/changelog Tue Feb 8 09:18:13 2011
@@ -1,3 +1,14 @@
+libtest-longstring-perl (0.15-1) unstable; urgency=low
+
+ * New upstream release
+ * debian/copyright:
+ - Update license stanzas
+ - Update copyright years
+ * debian/patches/fix-spelling-error:
+ - New patch to fix spelling error in manpage
+
+ -- Angel Abad <angelabad at gmail.com> Tue, 08 Feb 2011 10:16:47 +0100
+
libtest-longstring-perl (0.14-1) unstable; urgency=low
* New upstream release
Modified: trunk/libtest-longstring-perl/debian/control
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-longstring-perl/debian/control?rev=68149&op=diff
==============================================================================
--- trunk/libtest-longstring-perl/debian/control (original)
+++ trunk/libtest-longstring-perl/debian/control Tue Feb 8 09:18:13 2011
@@ -2,10 +2,12 @@
Section: perl
Priority: optional
Build-Depends: debhelper (>= 7)
-Build-Depends-Indep: libtest-pod-coverage-perl, libtest-pod-perl,
+Build-Depends-Indep: libtest-pod-coverage-perl,
+ libtest-pod-perl,
perl
Maintainer: Debian Perl Group <pkg-perl-maintainers at lists.alioth.debian.org>
-Uploaders: gregor herrmann <gregoa at debian.org>, Jonathan Yu <jawnsy at cpan.org>,
+Uploaders: gregor herrmann <gregoa at debian.org>,
+ Jonathan Yu <jawnsy at cpan.org>,
Krzysztof Krzyzaniak (eloy) <eloy at debian.org>,
Angel Abad <angelabad at gmail.com>
Standards-Version: 3.9.1
Modified: trunk/libtest-longstring-perl/debian/copyright
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-longstring-perl/debian/copyright?rev=68149&op=diff
==============================================================================
--- trunk/libtest-longstring-perl/debian/copyright (original)
+++ trunk/libtest-longstring-perl/debian/copyright Tue Feb 8 09:18:13 2011
@@ -4,13 +4,13 @@
Name: Test-LongString
Files: *
-Copyright: 2002-2010, Rafael Garcia-Suarez <rgs at consttype.org>
+Copyright: 2002-2011, Rafael Garcia-Suarez <rgs at consttype.org>
License: Artistic or GPL-1+
Files: debian/*
Copyright: 2006, 2008, gregor herrmann <gregoa at debian.org>
2006, Krzysztof Krzyzaniak (eloy) <eloy at debian.org>
- 2010, Angel Abad <angelabad at gmail.com>
+ 2010-2011, Angel Abad <angelabad at gmail.com>
2010, Jonathan Yu <jawnsy at cpan.org>
License: Artistic or GPL-1+
@@ -18,8 +18,8 @@
This program is free software; you can redistribute it and/or modify
it under the terms of the Artistic License, which comes with Perl.
.
- On Debian GNU/Linux systems, the complete text of the Artistic License
- can be found in `/usr/share/common-licenses/Artistic'.
+ On Debian systems, the complete text of the Artistic License can be
+ found in `/usr/share/common-licenses/Artistic'.
License: GPL-1+
This program is free software; you can redistribute it and/or modify
@@ -27,5 +27,5 @@
the Free Software Foundation; either version 1, or (at your option)
any later version.
.
- On Debian GNU/Linux systems, the complete text of version 1 of the
- General Public License can be found in `/usr/share/common-licenses/GPL-1'.
+ On Debian systems, the complete text of version 1 of the GNU General
+ Public License can be found in `/usr/share/common-licenses/GPL-1'.
Added: trunk/libtest-longstring-perl/debian/patches/fix-spelling-error
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-longstring-perl/debian/patches/fix-spelling-error?rev=68149&op=file
==============================================================================
--- trunk/libtest-longstring-perl/debian/patches/fix-spelling-error (added)
+++ trunk/libtest-longstring-perl/debian/patches/fix-spelling-error Tue Feb 8 09:18:13 2011
@@ -1,0 +1,15 @@
+Description: Fix spelling error in manpage
+Author: Angel Abad <angelabad at gmail.com>
+Forwarded: https://rt.cpan.org/Public/Bug/Display.html?id=65555
+
+--- a/lib/Test/LongString.pm
++++ b/lib/Test/LongString.pm
+@@ -443,7 +443,7 @@
+ where they differ, undefine C<$Test::LongString::Context>.
+
+ When computing line numbers this module uses "\n" to count line endings. This
+-may not be appropriate for strings on your platform, and can be overriden
++may not be appropriate for strings on your platform, and can be overridden
+ by setting the C<$Test::LongString::EOL> variable to a suitable regular
+ expression (either a reference to a regular expression or a string that
+ can be interpolated into a regular expression.)
Added: trunk/libtest-longstring-perl/debian/patches/series
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-longstring-perl/debian/patches/series?rev=68149&op=file
==============================================================================
--- trunk/libtest-longstring-perl/debian/patches/series (added)
+++ trunk/libtest-longstring-perl/debian/patches/series Tue Feb 8 09:18:13 2011
@@ -1,0 +1,1 @@
+fix-spelling-error
Modified: trunk/libtest-longstring-perl/lib/Test/LongString.pm
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-longstring-perl/lib/Test/LongString.pm?rev=68149&op=diff
==============================================================================
--- trunk/libtest-longstring-perl/lib/Test/LongString.pm (original)
+++ trunk/libtest-longstring-perl/lib/Test/LongString.pm Tue Feb 8 09:18:13 2011
@@ -1,9 +1,9 @@
package Test::LongString;
use strict;
-use vars qw($VERSION @ISA @EXPORT $Max $Context $LCSS);
-
-$VERSION = '0.14';
+use vars qw($VERSION @ISA @EXPORT $Max $Context $EOL $LCSS);
+
+$VERSION = '0.15';
use Test::Builder;
my $Tester = new Test::Builder();
@@ -22,10 +22,14 @@
# Boolean: should we show LCSS context ?
$LCSS = 1;
+# Regular expression that decides what a end of line is
+$EOL = "\n";
+
sub import {
(undef, my %args) = @_;
$Max = $args{max} if defined $args{max};
$LCSS = $args{lcss} if defined $args{lcss};
+ $EOL = $args{eol} if defined $args{eol};
@_ = $_[0];
goto &Exporter::import;
}
@@ -161,10 +165,13 @@
$Tester->ok($ok, $name);
if (!$ok) {
my ($g, $e) = (_display($str), _display($sub));
+ my $line = () = substr($str,0,$index-1) =~ /$EOL/g;
+ my $column = $line ? $index - $+[0] + 1: $index + 1;
+ $line++;
$Tester->diag(<<DIAG);
searched: $g
and found: $e
- at position: $index
+ at position: $index (line $line column $column)
DIAG
}
}
@@ -196,12 +203,15 @@
_display($got, $common_prefix),
_display($expected, $common_prefix),
);
+ my $line = () = substr($expected,0,$common_prefix) =~ /$EOL/g;
+ my $column = $line ? $common_prefix - $+[0] + 1 : $common_prefix + 1;
+ $line++;
$Tester->diag(<<DIAG);
got: $g
length: ${\(length $got)}
expected: $e
length: ${\(length $expected)}
- strings begin to differ at char ${\($common_prefix + 1)}
+ strings begin to differ at char ${\($common_prefix + 1)} (line $line column $column)
DIAG
return 0;
}
@@ -333,6 +343,10 @@
=item *
+It reports the line and column the strings started to differ on.
+
+=item *
+
In the diagnostics, non-ASCII characters are escaped as C<\x{xx}>.
=back
@@ -346,7 +360,7 @@
# length: 1490
# expected: "O Romeo, Romeo,\x{0a}wherefore art thou Romeo?\x{0a}Deny thy"...
# length: 154
- # strings begin to differ at char 1
+ # strings begin to differ at char 1 (line 1 column 1)
=head2 is_string_nows( $string, $expected [, $label ] )
@@ -409,7 +423,7 @@
# Failed test (soliloquy.t at line 10)
# searched: "To be, or not to be: that is the question:\x{0a}Whether"...
# and found: "slings"
- # at position: 147
+ # at position: 147 (line 3 column 4)
=head1 CONTROLLING OUTPUT
@@ -428,6 +442,16 @@
Test::LongString to always print the beginning of compared strings no matter
where they differ, undefine C<$Test::LongString::Context>.
+When computing line numbers this module uses "\n" to count line endings. This
+may not be appropriate for strings on your platform, and can be overriden
+by setting the C<$Test::LongString::EOL> variable to a suitable regular
+expression (either a reference to a regular expression or a string that
+can be interpolated into a regular expression.)
+
+You can also set it by specifying an argument to C<use>:
+
+ use Test::LongString eol => "\x{0a}\x{0c}";
+
=head1 AUTHOR
Written by Rafael Garcia-Suarez. Thanks to Mark Fowler (and to Joss Whedon) for
Modified: trunk/libtest-longstring-perl/t/01teststring.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-longstring-perl/t/01teststring.t?rev=68149&op=diff
==============================================================================
--- trunk/libtest-longstring-perl/t/01teststring.t (original)
+++ trunk/libtest-longstring-perl/t/01teststring.t Tue Feb 8 09:18:13 2011
@@ -14,35 +14,35 @@
test_out("not ok 1 - foo is foo");
test_fail(6);
-test_diag(qq( got: "bar"
+test_diag(qq! got: "bar"
# length: 3
# expected: "foo"
# length: 3
-# strings begin to differ at char 1));
+# strings begin to differ at char 1 (line 1 column 1)!);
is_string("bar", "foo", "foo is foo");
test_test("two small strings different");
test_out("not ok 1 - foo is foo");
test_fail(3);
-test_diag(qq( got: undef
-# expected: "foo"));
+test_diag(qq! got: undef
+# expected: "foo"!);
is_string(undef, "foo", "foo is foo");
test_test("got undef, expected small string");
test_out("not ok 1 - foo is foo");
test_fail(3);
-test_diag(qq( got: "foo"
-# expected: undef));
+test_diag(qq! got: "foo"
+# expected: undef!);
is_string("foo", undef, "foo is foo");
test_test("expected undef, got small string");
test_out("not ok 1 - long binary strings");
test_fail(6);
-test_diag(qq( got: "This is a long string that will be truncated by th"...
+test_diag(qq! got: "This is a long string that will be truncated by th"...
# length: 70
# expected: "\\x{00}\\x{01}foo\\x{0a}bar"
# length: 9
-# strings begin to differ at char 1));
+# strings begin to differ at char 1 (line 1 column 1)!);
is_string(
"This is a long string that will be truncated by the display() function",
"\0\1foo\nbar",
@@ -52,11 +52,11 @@
test_out("not ok 1 - spelling");
test_fail(6);
-test_diag(qq( got: "Element"
+test_diag(qq! got: "Element"
# length: 7
# expected: "El\\x{e9}ment"
# length: 7
-# strings begin to differ at char 3));
+# strings begin to differ at char 3 (line 1 column 3)!);
is_string(
"Element",
"Elément",
@@ -66,21 +66,21 @@
test_out('not ok 1 - foo\nfoo is foo\nfoo');
test_fail(6);
-test_diag(qq( got: "foo\\x{0a}foo"
+test_diag(qq! got: "foo\\x{0a}foo"
# length: 7
# expected: "foo\\x{0a}fpo"
# length: 7
-# strings begin to differ at char 6));
+# strings begin to differ at char 6 (line 2 column 2)!);
is_string("foo\nfoo", "foo\nfpo", 'foo\nfoo is foo\nfoo');
test_test("Count correctly prefix with multiline strings");
test_out("not ok 1 - this isn't Ulysses");
test_fail(6);
-test_diag(qq( got: ..."he bowl aloft and intoned:\\x{0a}--Introibo ad altare de"...
+test_diag(qq! got: ..."he bowl aloft and intoned:\\x{0a}--Introibo ad altare de"...
# length: 275
# expected: ..."he bowl alift and intoned:\\x{0a}--Introibo ad altare de"...
# length: 275
-# strings begin to differ at char 233));
+# strings begin to differ at char 233 (line 4 column 17)!);
is_string(
<<ULYS1,
Stately, plump Buck Mulligan came from the stairhead, bearing a bowl of
Modified: trunk/libtest-longstring-perl/t/02import.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-longstring-perl/t/02import.t?rev=68149&op=diff
==============================================================================
--- trunk/libtest-longstring-perl/t/02import.t (original)
+++ trunk/libtest-longstring-perl/t/02import.t Tue Feb 8 09:18:13 2011
@@ -9,11 +9,11 @@
test_out("not ok 1 - foobar is foobar");
test_fail(6);
-test_diag(qq( got: "foobu"...
+test_diag(qq! got: "foobu"...
# length: 6
# expected: "fooba"...
# length: 6
-# strings begin to differ at char 5));
+# strings begin to differ at char 5 (line 1 column 5)!);
is_string("foobur", "foobar", "foobar is foobar");
test_test("5 chars in output");
Modified: trunk/libtest-longstring-perl/t/05lacks.t
URL: http://svn.debian.org/wsvn/pkg-perl/trunk/libtest-longstring-perl/t/05lacks.t?rev=68149&op=diff
==============================================================================
--- trunk/libtest-longstring-perl/t/05lacks.t (original)
+++ trunk/libtest-longstring-perl/t/05lacks.t Tue Feb 8 09:18:13 2011
@@ -2,7 +2,7 @@
use strict;
-use Test::More tests => 4;
+use Test::More tests => 5;
use Test::Builder::Tester;
use Test::Builder::Tester::Color;
use Test::LongString;
@@ -17,9 +17,24 @@
test_fail(4);
test_diag(qq( searched: "Reese's Peanut Butter Cups"));
test_diag(qq( and found: "Peanut Butter"));
-test_diag(qq( at position: 8));
+test_diag(qq! at position: 8 (line 1 column 9)!);
lacks_string("Reese's Peanut Butter Cups", "Peanut Butter", "Any peanut butter in my chocolate?");
test_test("Not lacking");
+
+# Multiple lines
+test_out("not ok 1 - Mild?");
+test_fail(4);
+test_diag(qq( searched: "Stately, plump Buck Mulligan came from the stairhe"...));
+test_diag(qq( and found: "mild"));
+test_diag(qq! at position: 195 (line 3 column 51)!);
+lacks_string(<<'EXAMPLE',"mild","Mild?");
+Stately, plump Buck Mulligan came from the stairhead, bearing a bowl of
+lather on which a mirror and a razor lay crossed. A yellow dressinggown,
+ungirdled, was sustained gently behind him by the mild morning air. He
+held the bowl aloft and intoned:
+--Introibo ad altare dei.
+EXAMPLE
+test_test("Multiple lines not lacking");
# Source string undef
test_out("not ok 1 - Look inside undef");
More information about the Pkg-perl-cvs-commits
mailing list