Commit | Line | Data |
---|---|---|
95925ace SP |
1 | #!/usr/bin/perl -I. |
2 | ||
3 | #Causes Text::Wrap to die... | |
4 | use warnings; | |
5 | use strict; | |
6 | use Text::Wrap; | |
7 | ||
8 | my $toPrint = "(1) Category\t(2 or greater) New Category\n\n"; | |
9 | my $good = "(1) Category\t(2 or greater) New Category\n"; | |
10 | ||
11 | my $toprint; | |
12 | ||
13 | print "1..6\n"; | |
14 | ||
15 | local($Text::Wrap::break) = '\s'; | |
16 | eval { $toPrint = wrap("","",$toPrint); }; | |
17 | print $@ ? "not ok 1\n" : "ok 1\n"; | |
18 | print $toPrint eq $good ? "ok 2\n" : "not ok 2\n"; | |
19 | ||
20 | local($Text::Wrap::break) = '\d'; | |
21 | eval { $toPrint = wrap("","",$toPrint); }; | |
22 | print $@ ? "not ok 3\n" : "ok 3\n"; | |
23 | print $toPrint eq $good ? "ok 4\n" : "not ok 4\n"; | |
24 | ||
25 | local($Text::Wrap::break) = 'a'; | |
26 | eval { $toPrint = wrap("","",$toPrint); }; | |
27 | print $@ ? "not ok 5\n" : "ok 5\n"; | |
28 | print $toPrint eq $good ? "ok 6\n" : "not ok 6\n"; | |
29 |