diff options
Diffstat (limited to 'lib/encoding/warnings')
-rw-r--r-- | lib/encoding/warnings/t/1-warning.t | 29 | ||||
-rw-r--r-- | lib/encoding/warnings/t/2-fatal.t | 27 | ||||
-rw-r--r-- | lib/encoding/warnings/t/3-normal.t | 27 |
3 files changed, 83 insertions, 0 deletions
diff --git a/lib/encoding/warnings/t/1-warning.t b/lib/encoding/warnings/t/1-warning.t new file mode 100644 index 0000000000..d2b4af9191 --- /dev/null +++ b/lib/encoding/warnings/t/1-warning.t @@ -0,0 +1,29 @@ +#!/usr/bin/perl +# $File: /member/local/autrijus/encoding-warnings//t/1-warning.t $ $Author: autrijus $ +# $Revision: #5 $ $Change: 6145 $ $DateTime: 2004-07-16T03:49:06.717424Z $ + +use Test; +BEGIN { plan tests => 2 } + +use strict; +use encoding::warnings; +ok(encoding::warnings->VERSION); + +if ($] < 5.008) { + ok(1); + exit; +} + +my ($a, $b, $c, $ok); + +$SIG{__WARN__} = sub { + if ($_[0] =~ /upgraded/) { ok(1); exit } +}; + +utf8::encode($a = chr(20000)); +$b = chr(20000); +$c = $a . $b; + +ok($ok); + +__END__ diff --git a/lib/encoding/warnings/t/2-fatal.t b/lib/encoding/warnings/t/2-fatal.t new file mode 100644 index 0000000000..1047169a2f --- /dev/null +++ b/lib/encoding/warnings/t/2-fatal.t @@ -0,0 +1,27 @@ +#!/usr/bin/perl +# $File: /member/local/autrijus/encoding-warnings/t/2-fatal.t $ $Author: autrijus $ +# $Revision: #4 $ $Change: 1626 $ $DateTime: 2004-03-14T16:53:19.351256Z $ + +use Test; +BEGIN { plan tests => 2 } + +use strict; +use encoding::warnings 'FATAL'; +ok(encoding::warnings->VERSION); + +if ($] < 5.008) { + ok(1); + exit; +} + +my ($a, $b, $c, $ok); + +$SIG{__DIE__} = sub { + if ($_[0] =~ /upgraded/) { ok(1); exit } +}; + +utf8::encode($a = chr(20000)); +$b = chr(20000); +$c = $a . $b; + +ok($ok); diff --git a/lib/encoding/warnings/t/3-normal.t b/lib/encoding/warnings/t/3-normal.t new file mode 100644 index 0000000000..f573a86673 --- /dev/null +++ b/lib/encoding/warnings/t/3-normal.t @@ -0,0 +1,27 @@ +#!/usr/bin/perl +# $File: /member/local/autrijus/encoding-warnings/t/3-normal.t $ $Author: autrijus $ +# $Revision: #3 $ $Change: 1625 $ $DateTime: 2004-03-14T16:50:26.012462Z $ + +use Test; +BEGIN { plan tests => 2 } + +use strict; +use encoding::warnings 'FATAL'; +ok(encoding::warnings->VERSION); + +if ($] < 5.008) { + ok(1); + exit; +} + +my ($a, $b, $c, $ok); +$ok = 1; + +$SIG{__DIE__} = sub { $ok = 0 }; +$SIG{__WARN__} = sub { $ok = 0 }; + +$a = chr(20000); +$b = chr(20000); +$c = $a . $b; + +ok($ok); |