summaryrefslogtreecommitdiff
path: root/gnu/usr.bin/perl/lib/Text
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2009-10-12 18:11:22 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2009-10-12 18:11:22 +0000
commit3340aa359b7f1a5408b241506d923a8819934dce (patch)
tree7f684f171494914b3fc7979f440e6d6033ce01f1 /gnu/usr.bin/perl/lib/Text
parent64682a72ac119a8b4edb1b8bd9f7419964f9c778 (diff)
import perl 5.10.1
Diffstat (limited to 'gnu/usr.bin/perl/lib/Text')
-rwxr-xr-xgnu/usr.bin/perl/lib/Text/TabsWrap/t/dandv.t8
-rwxr-xr-xgnu/usr.bin/perl/lib/Text/TabsWrap/t/wrap_separator2.t13
2 files changed, 21 insertions, 0 deletions
diff --git a/gnu/usr.bin/perl/lib/Text/TabsWrap/t/dandv.t b/gnu/usr.bin/perl/lib/Text/TabsWrap/t/dandv.t
new file mode 100755
index 00000000000..b6ee69ada14
--- /dev/null
+++ b/gnu/usr.bin/perl/lib/Text/TabsWrap/t/dandv.t
@@ -0,0 +1,8 @@
+
+use Text::Wrap;
+use Test::More tests => 2;
+$Text::Wrap::columns = 4;
+eval { $x = Text::Wrap::wrap('', '123', 'some text'); };
+is($@, '');
+is($x, "some\n123t\n123e\n123x\n123t");
+
diff --git a/gnu/usr.bin/perl/lib/Text/TabsWrap/t/wrap_separator2.t b/gnu/usr.bin/perl/lib/Text/TabsWrap/t/wrap_separator2.t
new file mode 100755
index 00000000000..b31864fff5b
--- /dev/null
+++ b/gnu/usr.bin/perl/lib/Text/TabsWrap/t/wrap_separator2.t
@@ -0,0 +1,13 @@
+#!/usr/local/bin/perl -w
+#Author: Dan Dascalescu
+use strict;
+use Test::More tests => 1;
+
+use Text::Wrap;
+
+local $Text::Wrap::columns = 15;
+local $Text::Wrap::separator2 = '[N]';
+
+is(wrap('','','some long text here that should be wrapped on at least three lines'),
+"some long text[N]here that[N]should be[N]wrapped on at[N]least three[N]lines",
+'If you just to preserve existing newlines but add new breaks with something else, set $Text::Wrap::separator2 instead.');