File: 00-pipe.t

package info (click to toggle)
libtext-recordparser-perl 1.6.5-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 440 kB
  • sloc: perl: 3,351; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 717 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
20
21
22
23
24
25
#!/usr/bin/perl

#
# test for "field_separator" and "record_separator"
#

use strict;
use FindBin '$Bin';
use Test::More tests => 7;
use Text::RecordParser;

my $p = Text::RecordParser->new(
    
);
is( $p->field_separator, ',', 'Field separator is comma' );
is( $p->field_separator("\t"), "\t", 'Field separator is tab' );
is( $p->field_separator('::'), '::', 'Field separator is double colon' );
is( ref $p->field_separator(qr/\s+/), 'Regexp', 
    'Field separator is a regular expression' );

is( $p->record_separator, "\n", 'Record separator is newline' );
is( $p->record_separator("\n\n"), "\n\n", 
    'Record separator is double newline' 
);
is( $p->record_separator(':'), ':', 'Record separator is colon' );