File: scalar_ref_value.t

package info (click to toggle)
libbson-xs-perl 0.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,708 kB
  • sloc: ansic: 9,734; perl: 1,049; makefile: 3
file content (27 lines) | stat: -rw-r--r-- 420 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use strict;
use warnings;

use Test::More;
use Test::Fatal;
use lib 't/lib';
use lib 't/pvtlib';
use CleanEnv;

use BSON;
use boolean;

my $c = BSON->new;

# PERL-489 Providing a reference to a scalar was giving the memory reference not
# the scalar

my $value = 42.2;
$value = "hello";

is(
    exception { $c->encode_one( { value => \$value } ) },
    undef,
    "encoding ref to PVNV is not fatal",
);

done_testing;