]> git.vpit.fr Git - perl/modules/autovivification.git/blobdiff - t/41-padsv.t
Cover a_ck_padsv()
[perl/modules/autovivification.git] / t / 41-padsv.t
diff --git a/t/41-padsv.t b/t/41-padsv.t
new file mode 100644 (file)
index 0000000..f656a3a
--- /dev/null
@@ -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';