Debian lenny version packages
[pkg-perl] / deb-src / libio-stringy-perl / io-stringy-2.110 / t / IO_ScalarArray.t
1 #!/usr/bin/perl -w         #-*-Perl-*-
2
3 use lib "./t", "./lib"; 
4 use IO::ScalarArray;
5 use ExtUtils::TBone;
6 use Common;
7
8
9 #--------------------
10 #
11 # TEST...
12 #
13 #--------------------
14
15 my $RECORDSEP_TESTS = 'undef newline';
16 sub opener { my $a = [@{$_[0]}]; IO::ScalarArray->new($a); }
17
18 # Make a tester:
19 my $T = typical ExtUtils::TBone;
20 Common->test_init(TBone=>$T);
21
22 # Set the counter:
23 my $main_tests = 1;
24 my $common_tests = (1 + 1 + 4 + 4 + 3 + 4
25                     + Common->test_recordsep_count($RECORDSEP_TESTS));
26 $T->begin($main_tests + $common_tests);
27
28 # Open a scalar on a string, containing initial data:
29 my @sa = @Common::DATA_SA;
30 my $SAH = IO::ScalarArray->new(\@sa);
31 $T->ok($SAH, "OPEN: open a scalar on a ref to an array");
32
33 # Run standard tests:
34 Common->test_print($SAH);
35 Common->test_getc($SAH);
36 Common->test_getline($SAH);
37 Common->test_read($SAH);
38 Common->test_seek($SAH);
39 Common->test_tie(TieArgs => ['IO::ScalarArray', []]);
40 Common->test_recordsep($RECORDSEP_TESTS, \&opener);
41
42 # So we know everything went well...
43 $T->end;
44
45
46
47
48
49
50
51