Add ARM files
[dh-make-perl] / dev / arm / libio-stringy-perl / io-stringy-2.110 / t / IO_Scalar.t
1 #!/usr/bin/perl -w         #-*-Perl-*-
2
3 use lib "./t", "./lib"; 
4 use IO::Scalar;
5 use ExtUtils::TBone;
6 use Common;
7
8
9 #--------------------
10 #
11 # TEST...
12 #
13 #--------------------
14
15 my $RECORDSEP_TESTS = 'undef empty custom newline';
16 sub opener { my $s = join('', @{$_[0]}); IO::Scalar->new(\$s); }
17
18 ### Make a tester:
19 my $T = typical ExtUtils::TBone;
20 Common->test_init(TBone=>$T);
21 $T->log_warnings;
22
23 ### Set the counter:
24 my $main_tests = 1 + 1;
25 my $common_tests = (1 + 1 + 4 + 4 + 3 + 4
26                     + Common->test_recordsep_count($RECORDSEP_TESTS));
27 $T->begin($main_tests + $common_tests);
28
29 ### Open a scalar on a string, containing initial data:
30 my $s = $Common::DATA_S;
31 my $SH = IO::Scalar->new(\$s);
32 $T->ok($SH, "OPEN: open a scalar on a ref to a string");
33
34 ### Run standard tests:
35 Common->test_print($SH);
36 $T->ok(($s eq $Common::FDATA_S), "FULL",
37        S=>$s, F=>$Common::FDATA_S);
38 Common->test_getc($SH);
39 Common->test_getline($SH);
40 Common->test_read($SH);
41 Common->test_seek($SH);
42 Common->test_tie(TieArgs => ['IO::Scalar']);
43 Common->test_recordsep($RECORDSEP_TESTS, \&opener);
44
45 ### So we know everything went well...
46 $T->end;
47
48