summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteffen Mueller <smueller@cpan.org>2011-02-19 14:02:03 +0100
committerSteffen Mueller <smueller@cpan.org>2011-07-12 20:54:50 +0200
commitbb2320f04fbb453056598c13ceb3debffbde54e5 (patch)
treed557e6887c59b114dff7057a94f47988eb449f4c
parentab018b010dc7d4695e222a3f411941eb8d39e681 (diff)
downloadperl-bb2320f04fbb453056598c13ceb3debffbde54e5.tar.gz
Some simple tests for errors
-rw-r--r--dist/ExtUtils-ParseXS/t/510-t-bare.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/dist/ExtUtils-ParseXS/t/510-t-bare.t b/dist/ExtUtils-ParseXS/t/510-t-bare.t
index a58bca874a..a2f359d80e 100644
--- a/dist/ExtUtils-ParseXS/t/510-t-bare.t
+++ b/dist/ExtUtils-ParseXS/t/510-t-bare.t
@@ -2,7 +2,7 @@
use strict;
use warnings;
-use Test::More tests => 30;
+use Test::More tests => 38;
use ExtUtils::Typemaps;
# typemap only
@@ -19,6 +19,16 @@ HERE
is($type->ctype, 'unsigned int');
is($type->xstype, 'T_IV');
is($type->tidy_ctype, 'unsigned int');
+
+ # test failure
+ ok(!$map->get_typemap(ctype => 'foo'), "Access to nonexistent typemap doesn't die");
+ ok(!$map->get_inputmap(ctype => 'foo'), "Access to nonexistent inputmap via ctype doesn't die");
+ ok(!$map->get_outputmap(ctype => 'foo'), "Access to nonexistent outputmap via ctype doesn't die");
+ ok(!$map->get_inputmap(xstype => 'foo'), "Access to nonexistent inputmap via xstype doesn't die");
+ ok(!$map->get_outputmap(xstype => 'foo'), "Access to nonexistent outputmap via xstype doesn't die");
+ ok(!eval{$map->get_typemap('foo')} && $@, "Access to typemap with positional params dies");
+ ok(!eval{$map->get_inputmap('foo')} && $@, "Access to inputmap with positional params dies");
+ ok(!eval{$map->get_outputmap('foo')} && $@, "Access to outputmap with positional params dies");
}
# typemap & input