when dumping a ref to an SV that has weaken magic it's incorrectly serialized as a blessed
string instead of a scalar ref
Subject: | weaken-scalarss.t |
#!/usr/bin/perl
use strict;
use warnings;
use Test::More;
use YAML::XS;
use Scalar::Util qw(weaken);
my $ref = \"foo";
my $weak = $ref;
is_deeply( Load(my $before = Dump($ref)), $ref, "Round trip scalar ref" );
weaken($weak);
is_deeply( Load(my $after = Dump($ref)), $ref, "Round trip scalar ref with a weak ref to it" );
is( $before, $after, "dump output is the same" );
done_testing;