summaryrefslogtreecommitdiff
path: root/dist/I18N-Collate/t
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-01-24 15:33:52 +0000
committerNicholas Clark <nick@ccl4.org>2011-01-24 16:28:55 +0000
commit0407acb5f2d891b70e3bd5b9958c07a0f630019c (patch)
treea20f317fb04a4483bbaece1ba2aba6fc1f5b3aeb /dist/I18N-Collate/t
parentf133ac5ddfc5d70fa61dd22a319c90b6c5016bc0 (diff)
downloadperl-0407acb5f2d891b70e3bd5b9958c07a0f630019c.tar.gz
Convert I18N::Colate's test to Test::More.
Diffstat (limited to 'dist/I18N-Collate/t')
-rw-r--r--dist/I18N-Collate/t/I18N-Collate.t26
1 files changed, 10 insertions, 16 deletions
diff --git a/dist/I18N-Collate/t/I18N-Collate.t b/dist/I18N-Collate/t/I18N-Collate.t
index 17280266e9..4f12cba3ec 100644
--- a/dist/I18N-Collate/t/I18N-Collate.t
+++ b/dist/I18N-Collate/t/I18N-Collate.t
@@ -3,44 +3,38 @@
# at least in the CPAN version we're sometimes called with -w, for example
# during 'make test', so disable them explicitly and only turn them on again for
# the deprecation test.
+use strict;
no warnings;
BEGIN {
require Config; import Config;
- if (!$Config{d_setlocale} || $Config{ccflags} =~ /\bD?NO_LOCALE\b/) {
+ if (!$::Config{d_setlocale} || $::Config{ccflags} =~ /\bD?NO_LOCALE\b/) {
print "1..0\n";
exit;
}
}
-print "1..7\n";
+use Test::More tests => 7;
-use I18N::Collate;
-
-print "ok 1\n";
+BEGIN {use_ok('I18N::Collate');}
$a = I18N::Collate->new("foo");
-print "ok 2\n";
+isa_ok($a, 'I18N::Collate');
{
use warnings;
local $SIG{__WARN__} = sub { $@ = $_[0] };
$b = I18N::Collate->new("foo");
- print "not " unless $@ =~ /\bHAS BEEN DEPRECATED\b/;
- print "ok 3\n";
+ like($@, qr/\bHAS BEEN DEPRECATED\b/);
$@ = '';
}
-print "not " unless $a eq $b;
-print "ok 4\n";
+is($a, $b, 'same object');
$b = I18N::Collate->new("bar");
-print "not " if $@ =~ /\bHAS BEEN DEPRECATED\b/;
-print "ok 5\n";
+unlike($@, qr/\bHAS BEEN DEPRECATED\b/);
-print "not " if $a eq $b;
-print "ok 6\n";
+isnt($a, $b, 'different object');
-print "not " if $a lt $b == $a gt $b;
-print "ok 7\n";
+cmp_ok($a lt $b, '!=', $a gt $b);