summaryrefslogtreecommitdiff
path: root/cpan/dist/IO-stringy/t/IO_ScalarArray.t
blob: 299559117697d06fcd30798b27eb1b337d11b583 (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
44
45
46
47
48
49
#!/usr/bin/perl -w         #-*-Perl-*-

use lib "./t", "./lib"; 
use IO::ScalarArray;
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 @sa = @Common::DATA_SA;
my $SAH = IO::ScalarArray->new(\@sa);
$T->ok($SAH, "OPEN: open a scalar on a ref to an array");

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

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

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