From: Vincent Pit Date: Fri, 19 Jun 2009 23:07:40 +0000 (+0200) Subject: Cover a_ck_padsv() X-Git-Tag: v0.03~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=d1fe129b437d8a04354f8231ca59c2e8fb23ccba;p=perl%2Fmodules%2Fautovivification.git Cover a_ck_padsv() --- diff --git a/MANIFEST b/MANIFEST index 979aa88..e8b9792 100644 --- a/MANIFEST +++ b/MANIFEST @@ -13,6 +13,7 @@ t/21-hash-specific.t t/30-array.t t/31-array-fast.t t/40-scope.t +t/41-padsv.t t/91-pod.t t/92-pod-coverage.t t/95-portability-files.t diff --git a/t/41-padsv.t b/t/41-padsv.t new file mode 100644 index 0000000..f656a3a --- /dev/null +++ b/t/41-padsv.t @@ -0,0 +1,18 @@ +#!perl -T + +use strict; +use warnings; + +use Test::More tests => 4; + +my $buf = "abc\ndef\n"; +open my $x, '<', \$buf; + +# Do this one first so that the check functions are set up for the second +my $res = eval 'no autovivification; <$x>'; +is $@, '', 'padsv 1: no error'; +is $res, "abc\n", 'padsv 1: correct returned value'; + +$res = eval '<$x>'; +is $@, '', 'padsv 2: no error'; +is $res, "def\n", 'padsv 2: correct returned value';