File: 09-open.t

package info (click to toggle)
libio-pager-perl 2.10-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 284 kB
  • sloc: perl: 1,416; makefile: 14
file content (24 lines) | stat: -rw-r--r-- 573 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use warnings;
use File::Spec;
use Test::More 0.88;
require './t/TestUtils.pm';
t::TestUtils->import();

use IO::Pager;

SKIP: {
  skip("Skipping because Windows has to be different^Wdifficult", 1)
    if $^O =~ /MSWin32|cygwin/;

  undef $ENV{PAGER};
  eval{ my $token = new IO::Pager };
  like($@, qr/The PAGER environment variable is not defined/, 'PAGER undefined since find_pager()');
  
  $ENV{PAGER} = File::Spec->devnull();
  eval{ my $token = new IO::Pager or die $!};
  like($@, qr/Could not pipe to PAGER/, 'Could not create pipe');
}

done_testing;