#!/usr/bin/perl
use
strict;
use
warnings;
use
Test::More;
BEGIN {
$ENV
{PERL_BSON_BACKEND} =
""
}
BEGIN {
$INC
{
"BSON/XS.pm"
} =
undef
}
if
(
eval
(
"use Test::Exception; 1"
) ) {
plan
tests
=> 2;
}
else
{
plan
skip_all
=>
'No Test::Exception installed'
}
dies_ok(
sub
{ decode(
"something"
) },
"Incorrect BSON"
);
dies_ok(
sub
{ decode(
"\5\0\0\0 1234\0"
) },
"Unsupported type"
)