From: Vincent Pit Date: Tue, 10 Mar 2009 16:12:38 +0000 (+0100) Subject: Test import and prototypes in t/01-import.t X-Git-Tag: v0.11~4 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=1a5910bd40eb93ca8b46dbb37ba3e02010382567;p=perl%2Fmodules%2FLinux-SysInfo.git Test import and prototypes in t/01-import.t --- diff --git a/MANIFEST b/MANIFEST index 275cab8..0deae0e 100644 --- a/MANIFEST +++ b/MANIFEST @@ -7,6 +7,7 @@ SysInfo.xs lib/Linux/SysInfo.pm samples/sysinfo.pl t/00-load.t +t/01-import.t t/10-standard.t t/20-extended.t t/90-boilerplate.t diff --git a/SysInfo.xs b/SysInfo.xs index fdb289e..e46439c 100644 --- a/SysInfo.xs +++ b/SysInfo.xs @@ -94,6 +94,7 @@ BOOT: } SV *sysinfo() +PROTOTYPE: PREINIT: struct sysinfo si; NV l; diff --git a/t/01-import.t b/t/01-import.t new file mode 100644 index 0000000..8a3b3da --- /dev/null +++ b/t/01-import.t @@ -0,0 +1,19 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More tests => 2 * 2; + +require Linux::SysInfo; + +my %syms = ( + sysinfo => '', + LS_HAS_EXTENDED => '', +); + +for (keys %syms) { + eval { Linux::SysInfo->import($_) }; + is $@, '', "import $_"; + is prototype($_), $syms{$_}, "prototype $_"; +}