sv = NEWSV(10002, len);
SEEN(sv, cname, 0); /* Associate this new scalar with tag "tagnum" */
+ if (len == 0) {
+ sv_setpvn(sv, "", 0);
+ return sv;
+ }
+
/*
* WARNING: duplicates parts of sv_setpv and breaks SV data encapsulation.
*
# present in files, but not in things store()ed to memory
$fancy = ($] > 5.007 ? 2 : 0);
-plan tests => 368 + length ($byteorder) * 4 + $fancy * 8 + 1;
+plan tests => 372 + length ($byteorder) * 4 + $fancy * 8;
use Storable qw (store retrieve freeze thaw nstore nfreeze);
require 'testlib.pl';
# us, which will probably alert the user that something went wrong.
ok(1);
}
+
+# Unusual in that the empty string is stored with an SX_LSCALAR marker
+my $hash = store_and_retrieve("pst0\5\6\3\0\0\0\1\1\0\0\0\0\0\0\0\5empty");
+ok(!$@, "no exception");
+is(ref($hash), "HASH", "got a hash");
+is($hash->{empty}, "", "got empty element");