File: rt-57524.t

package info (click to toggle)
libcgi-pm-perl 4.68-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,028 kB
  • sloc: perl: 6,082; makefile: 9
file content (19 lines) | stat: -rw-r--r-- 450 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use strict;
use warnings;

use Test::More tests => 6;

use CGI;

foreach my $fh ( \*STDOUT,\*STDIN,\*STDERR ) {
	binmode( STDOUT,':utf8' );
	my %layers = map { $_ => 1 } PerlIO::get_layers( \*STDOUT );
	ok( $layers{utf8},'set utf8 on STDOUT' );
}

CGI::_set_binmode();

foreach my $fh ( \*STDOUT,\*STDIN,\*STDERR ) {
	my %layers = map { $_ => 1 } PerlIO::get_layers( \*STDOUT );
	ok( $layers{utf8},'layers were not lost in call to _set_binmode' );
}