File: 15-blob.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 (20 lines) | stat: -rw-r--r-- 426 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! perl

# Test blob reading.

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

use File::LoadLines;

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

# Testing not-touching.
my $data = "\x{EF}\x{BB}\x{BF}first\0\nsecond\r\nthird\0\r\n";
my @lines = loadlines( \$data, { blob => 1 } );
is( scalar(@lines), 1, "single lines" );
is( $lines[0], $data, "data\@ ok" );
my $d = loadlines( \$data, { blob => 1 } );
is( $d, $data, "data\$ ok" );