summaryrefslogtreecommitdiff
path: root/cpan/dist/IO-stringy/t/IO_Lines.t
blob: 13fc13c017e03e621157729e44862c060e54568f (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/usr/bin/perl -w         #-*-Perl-*-

use lib "./t", "./lib"; 
use IO::Lines;
use ExtUtils::TBone;
use Common;


#--------------------
#
# TEST...
#
#--------------------

# Make a tester:
my $T = typical ExtUtils::TBone;
Common->test_init(TBone=>$T);

# Set the counter:
my $tie_tests = (($] >= 5.004) ? 4 : 0);
$T->begin(11 + $tie_tests);

# Open a scalar on a string, containing initial data:
my @la = @Common::DATA_LA;
my $LAH = IO::Lines->new(\@la);
$T->ok($LAH, "OPEN: open a scalar on a ref to an array");

# Run standard tests:
Common->test_print($LAH);
Common->test_getc($LAH);
Common->test_getline($LAH);
Common->test_read($LAH);
#Common->test_seek($LAH);

# Run tie tests:
if ($tie_tests) {
    Common->test_tie(TieArgs => ['IO::Lines', []]);
}

# So we know everything went well...
$T->end;