Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add exception tests

  • Loading branch information...
commit 4c3c6ec6113346b2342f67af5cd522b0751bcf24 1 parent fed00a4
minimalist authored
Showing with 21 additions and 0 deletions.
  1. +1 −0  MANIFEST
  2. +20 −0 t/12-exception.t
View
1  MANIFEST
@@ -21,3 +21,4 @@ t/06-timestamp.t
t/07-minmaxkey.t
t/10-bson.t
t/11-random.t
+t/12-exception.t
View
20 t/12-exception.t
@@ -0,0 +1,20 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+if ( eval("use Test::Exception; 1") ) {
+ plan tests => 2;
+}
+else {
+ plan skip_all => 'No Test::Exception installed'
+}
+
+use lib '../lib'; # TODO
+use BSON qw/encode decode/;
+
+dies_ok( sub{ decode("something") }, "Incorrect BSON");
+dies_ok( sub{ decode("\5\0\0\0 1234\0") }, "Unsupported type" )
+
Please sign in to comment.
Something went wrong with that request. Please try again.