File: 17-softfail.t

package info (click to toggle)
libfile-loadlines-perl 1.047-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 204 kB
  • sloc: perl: 545; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 364 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#! perl

# Test soft failure.

use strict;
use warnings;
use Test::More tests => 2;
use utf8;

use File::LoadLines;

-d "t" && chdir "t";

# Testing soft errors.
my $opt = { fail => "soft" };
my @lines = loadlines( "a hopefully not existing file", $opt );
is( scalar(@lines), 0, "no lines" );
ok( $opt->{error}, "error ok" );
note("Error message: $opt->{error}");