X-Git-Url: http://git.maemo.org/git/?p=dh-make-perl;a=blobdiff_plain;f=dev%2Fi386%2Flibio-stringy-perl%2Fio-stringy-2.110%2Ft%2FIO_WrapTie.t;fp=dev%2Fi386%2Flibio-stringy-perl%2Fio-stringy-2.110%2Ft%2FIO_WrapTie.t;h=2817ca471878bc4117671fe3bf24759100a7a803;hp=0000000000000000000000000000000000000000;hb=8977e561d8a9eae6959218b0306c9df2056a38a9;hpb=df794b845212301ea0d267c919232538bfef356a diff --git a/dev/i386/libio-stringy-perl/io-stringy-2.110/t/IO_WrapTie.t b/dev/i386/libio-stringy-perl/io-stringy-2.110/t/IO_WrapTie.t new file mode 100644 index 0000000..2817ca4 --- /dev/null +++ b/dev/i386/libio-stringy-perl/io-stringy-2.110/t/IO_WrapTie.t @@ -0,0 +1,66 @@ +#!/usr/bin/perl -w #-*-Perl-*- + +use lib "./t"; +use IO::Handle; +use IO::Scalar; +use ExtUtils::TBone; +use IO::WrapTie; + +#-------------------- +# +# TEST... +# +#-------------------- + +# Make a tester: +my $T = typical ExtUtils::TBone; + +# Set the counter: +unless ($] >= 5.004) { + $T->begin(1); + $T->ok(1); + $T->end; + exit 0; +} +$T->begin(6); + +my $hello = 'Hello, '; +my $world = "world!\n"; + +#### test +my $s = ''; +my $SH = new IO::WrapTie 'IO::Scalar', \$s; +$T->ok(1, "Construction"); + +#### test +print $SH $hello, $world; +$T->ok($s eq "$hello$world", + "print FH ARGS", + S => $s); + +#### test +$SH->print($hello, $world); +$T->ok($s eq "$hello$world$hello$world", + "FH->print(ARGS)", + S => $s); + +#### test +$SH->seek(0,0); +$T->ok(1, "FH->seek(0,0)"); + +#### test +@x = <$SH>; +$T->ok((($x[0] eq "$hello$world") && + ($x[1] eq "$hello$world") && + !$x[2]), + "array = "); + +#### test +my $sref = $SH->sref; +$T->ok($sref eq \$s, "FH->sref"); + + +# So we know everything went well... +$T->end; + +