In perl.git, the branch smueller/typemapdocs4 has been updated <http://perl5.git.perl.org/perl.git/commitdiff/45cbfec97cf5827f96b43bc1ebecf2ec80bf60aa?hp=63436310cb6c5b9f76a94f3c4d3a139ffd30b3bc>
- Log ----------------------------------------------------------------- commit 45cbfec97cf5827f96b43bc1ebecf2ec80bf60aa Author: Steffen Mueller <[email protected]> Date: Thu Jan 26 19:18:33 2012 +0100 XS::Typemap: Tests for T_INOUT typemap ----------------------------------------------------------------------- Summary of changes: ext/XS-Typemap/Typemap.pm | 1 + ext/XS-Typemap/Typemap.xs | 9 +++++++++ ext/XS-Typemap/t/Typemap.t | 13 ++++++++++++- 3 files changed, 22 insertions(+), 1 deletions(-) diff --git a/ext/XS-Typemap/Typemap.pm b/ext/XS-Typemap/Typemap.pm index 38c53ce..ec08e86 100644 --- a/ext/XS-Typemap/Typemap.pm +++ b/ext/XS-Typemap/Typemap.pm @@ -77,6 +77,7 @@ $VERSION = '0.08'; T_STDIO_open T_STDIO_close T_STDIO_print T_PACKED_in T_PACKED_out T_PACKEDARRAY_in T_PACKEDARRAY_out + T_INOUT /); XSLoader::load(); diff --git a/ext/XS-Typemap/Typemap.xs b/ext/XS-Typemap/Typemap.xs index 906a66c..11b32b0 100644 --- a/ext/XS-Typemap/Typemap.xs +++ b/ext/XS-Typemap/Typemap.xs @@ -1415,6 +1415,15 @@ writing. See L<perliol> for more information on the Perl IO abstraction layer. Perl must have been built with C<-Duseperlio>. +=cut + +PerlIO * +T_INOUT(in) + PerlIO *in; + CODE: + RETVAL = in; /* silly test but better than nothing */ + OUTPUT: RETVAL + =item T_OUT NOT YET diff --git a/ext/XS-Typemap/t/Typemap.t b/ext/XS-Typemap/t/Typemap.t index 40946f5..e63ae62 100644 --- a/ext/XS-Typemap/t/Typemap.t +++ b/ext/XS-Typemap/t/Typemap.t @@ -6,7 +6,7 @@ BEGIN { } } -use Test::More tests => 108; +use Test::More tests => 109; use strict; use warnings; @@ -355,3 +355,14 @@ if (defined $fh) { } } +# T_INOUT +SCOPE: { + my $buf = ''; + local $| = 1; + open my $fh, "+>", \$buf or die $!; + my $str = "Fooo!\n"; + print $fh $str; + my $fh2 = T_INOUT($fh); + seek($fh2, 0, 0); + ok(readline($fh2), $str, 'T_INOUT'); +} -- Perl5 Master Repository
