Apophis

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

DM_RUID|5.003007||Viu
DM_UID|5.003007||Viu
dMULTICALL|5.009003|5.009003|
dMY_CXT|5.009000|5.009000|p
dMY_CXT_INTERP|5.009003||Viu
dMY_CXT_SV|5.033001|5.033001|p
dNOOP|5.006000|5.003007|p
do_aexec|5.009003||Viu
do_aexec5|5.006000||Viu
do_aspawn|5.008000||Vu
do_binmode|5.004005|5.004005|du
docatch|5.005000||Vi
do_chomp|5.003007||Viu
do_close|5.003007|5.003007|u
do_delete_local|5.011000||Viu
do_dump_pad|5.008001||Vi
do_eof|5.003007||Viu
does_utf8_overflow|5.025006||Vniu
doeval_compile|5.023008||Viu
do_exec3|5.006000||Viu
do_exec|5.009003||Viu

ppport.h  view on Meta::CPAN

KELVIN_SIGN|5.017003||Viu
KERNEL|5.003007||Viu
KEY_abs|5.003007||Viu
KEY_accept|5.003007||Viu
KEY_alarm|5.003007||Viu
KEY_and|5.003007||Viu
KEY_atan2|5.003007||Viu
KEY_AUTOLOAD|5.003007||Viu
KEY_BEGIN|5.003007||Viu
KEY_bind|5.003007||Viu
KEY_binmode|5.003007||Viu
KEY_bless|5.003007||Viu
KEY_break|5.027008||Viu
KEY_caller|5.003007||Viu
KEY_chdir|5.003007||Viu
KEY_CHECK|5.006000||Viu
KEY_chmod|5.003007||Viu
KEY_chomp|5.003007||Viu
KEY_chop|5.003007||Viu
KEY_chown|5.003007||Viu
KEY_chr|5.003007||Viu

ppport.h  view on Meta::CPAN

mXPUSHi|5.009002|5.003007|p
mXPUSHn|5.009002|5.003007|p
mXPUSHp|5.009002|5.003007|p
mXPUSHs|5.010001|5.003007|p
mXPUSHu|5.009002|5.003007|p
my|5.011000||Viu
my_atof2|5.029000||cVu
my_atof3|5.029000||cVu
my_atof|5.006000|5.006000|
my_attrs|5.006000||Viu
my_binmode|5.006000||Viu
my_bytes_to_utf8|5.021009||Vniu
my_chsize|5.003007||Vu
my_clearenv|5.009003||Viu
MY_CXT|5.009000|5.009000|p
MY_CXT_CLONE|5.009002|5.009000|p
MY_CXT_INDEX|5.009005||Viu
MY_CXT_INIT|5.009000|5.009000|p
my_cxt_init|5.010000|5.010000|u
MY_CXT_INIT_ARG|5.013005||Viu
MY_CXT_INIT_INTERP|5.009003||Viu

ppport.h  view on Meta::CPAN

PERL_INC_VERSION_LIST|5.033000|5.033000|Vn
Perl_internal_drand48|5.027004||Viu
PERL_INTERPRETER_SIZE_UPTO_MEMBER|5.010000||Viu
PERL_INT_MAX|5.003007|5.003007|p
PERL_INT_MIN|5.003007|5.003007|p
PERL_INVLIST_INLINE_H|5.029006||Viu
PerlIO|5.003007||Viu
PerlIO_apply_layers|5.007001|5.007001|
PerlIOArg|5.007001||Viu
PerlIOBase|5.007001||Viu
PerlIO_binmode|5.007001|5.007001|
PERLIOBUF_DEFAULT_BUFSIZ|5.013007||Viu
PerlIO_canset_cnt|5.003007|5.003007|n
PerlIO_clearerr|5.007003|5.007003|
PerlIO_close|5.007003|5.007003|
PerlIO_context_layers|5.009004|5.009004|u
PerlIO_debug|5.007001|5.007001|
PERLIO_DUP_CLONE|5.007003||Viu
PERLIO_DUP_FD|5.007003||Viu
PerlIO_eof|5.007003|5.007003|
PerlIO_error|5.007003|5.007003|

t/07-streaming.t  view on Meta::CPAN

use warnings;
use Test::More tests => 4;
use File::Temp qw(tempfile tempdir);
use Apophis;

my $ca = Apophis->new(namespace => 'test-streaming');

# identify_file matches identify for same content
my $content = 'streaming test content here';
my ($fh, $filename) = tempfile(UNLINK => 1);
binmode $fh;
print $fh $content;
close $fh;

my $id_mem = $ca->identify(\$content);
my $id_file = $ca->identify_file($filename);
is($id_mem, $id_file, 'identify_file matches identify for same content');

# Large content (> one 64KB buffer)
my $large = 'x' x 100_000;
my ($fh2, $filename2) = tempfile(UNLINK => 1);
binmode $fh2;
print $fh2 $large;
close $fh2;

my $id_large_mem = $ca->identify(\$large);
my $id_large_file = $ca->identify_file($filename2);
is($id_large_mem, $id_large_file, 'streaming matches in-memory for large content');

# Binary content
my $binary = join('', map { chr($_) } 0..255) x 100;
my ($fh3, $filename3) = tempfile(UNLINK => 1);
binmode $fh3;
print $fh3 $binary;
close $fh3;

my $id_bin_mem = $ca->identify(\$binary);
my $id_bin_file = $ca->identify_file($filename3);
is($id_bin_mem, $id_bin_file, 'streaming matches in-memory for binary content');

# Empty file
my ($fh4, $filename4) = tempfile(UNLINK => 1);
close $fh4;



( run in 0.808 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )