File: 41-padsv.t

package info (click to toggle)
libautovivification-perl 0.18-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 440 kB
  • sloc: perl: 3,573; ansic: 1,507; makefile: 8
file content (18 lines) | stat: -rw-r--r-- 438 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!perl -T

use strict;
use warnings;

use Test::More tests => 4;

my $buf = "abc\ndef\n";
open my $x, '<', \$buf;

# Do this one first so that the check functions are set up for the second
my $res = eval 'no autovivification; <$x>';
is $@,   '',      'padsv 1: no error';
is $res, "abc\n", 'padsv 1: correct returned value';

$res = eval '<$x>';
is $@,   '',      'padsv 2: no error';
is $res, "def\n", 'padsv 2: correct returned value';