1 #!/usr/bin/perl -w #-*-Perl-*-
3 use lib "./t", "./lib";
15 my $RECORDSEP_TESTS = 'undef empty custom newline';
16 sub opener { my $s = join('', @{$_[0]}); IO::Scalar->new(\$s); }
19 my $T = typical ExtUtils::TBone;
20 Common->test_init(TBone=>$T);
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);
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");
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);
45 ### So we know everything went well...