I think this is quite enough testing for a deprecated feature.
Jarkko Hietaniemi [Wed, 16 May 2001 19:58:29 +0000 (19:58 +0000)]
p4raw-id: //depot/perl@10140

MANIFEST
t/lib/1_compile.t
t/lib/i18n-collate.t [new file with mode: 0644]

index 52e4367..e6c5179 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -1535,6 +1535,7 @@ t/lib/h2ph.h              Test header file for h2ph
 t/lib/h2ph.pht         Generated output from h2ph.h by h2ph, for comparison
 t/lib/h2ph.t           See if h2ph works like it should
 t/lib/hostname.t       See if Sys::Hostname works
+t/lib/i18n-collate.t   See if I18N::Collate works
 t/lib/io_const.t       See if constants from IO work
 t/lib/io_dir.t         See if directory-related methods from IO work
 t/lib/io_dup.t         See if dup()-related methods from IO work
index 75801bb..f1196f4 100644 (file)
@@ -158,6 +158,7 @@ FindBin
 GDBM_File
 Getopt::Long
 Getopt::Std
+I18N:Collate
 IO::Dir
 IO::File
 IO::Handle
diff --git a/t/lib/i18n-collate.t b/t/lib/i18n-collate.t
new file mode 100644 (file)
index 0000000..bf3ba20
--- /dev/null
@@ -0,0 +1,44 @@
+#!./perl
+
+BEGIN {
+    chdir 't' if -d 't';
+    @INC = '../lib';
+    require Config; import Config;
+    if (!$Config{d_setlocale} || $Config{ccflags} =~ /\bD?NO_LOCALE\b/) {
+       print "1..0\n";
+       exit;
+    }
+}
+
+print "1..7\n";
+
+use I18N::Collate;
+
+print "ok 1\n";
+
+$a = I18N::Collate->new("foo");
+
+print "ok 2\n";
+
+{
+    use warnings;
+    local $SIG{__WARN__} = sub { $@ = $_[0] };
+    $b = I18N::Collate->new("foo");
+    print "not " unless $@ =~ /\bHAS BEEN DEPRECATED\b/;
+    print "ok 3\n";
+    $@ = '';
+}
+
+print "not " unless $a eq $b;
+print "ok 4\n";
+
+$b = I18N::Collate->new("bar");
+print "not " if $@ =~ /\bHAS BEEN DEPRECATED\b/;
+print "ok 5\n";
+
+print "not " if $a eq $b;
+print "ok 6\n";
+
+print "not " if $a lt $b == $a gt $b;
+print "ok 7\n";
+