t/regression/scalar_ref_value.t
raw| 1 | use strict; |
| 2 | use warnings; |
| 3 | |
| 4 | use Test::More; |
| 5 | use Test::Fatal; |
| 6 | use lib 't/lib'; |
| 7 | use lib 't/pvtlib'; |
| 8 | use CleanEnv; |
| 9 | |
| 10 | use BSON; |
| 11 | use boolean; |
| 12 | |
| 13 | my $c = BSON->new; |
| 14 | |
| 15 | # PERL-489 Providing a reference to a scalar was giving the memory reference not |
| 16 | # the scalar |
| 17 | |
| 18 | my $value = 42.2; |
| 19 | $value = "hello"; |
| 20 | |
| 21 | is( |
| 22 | exception { $c->encode_one( { value => \$value } ) }, |
| 23 | undef, |
| 24 | "encoding ref to PVNV is not fatal", |
| 25 | ); |
| 26 | |
| 27 | done_testing; |