1 use Test::More tests => 12;
3 BEGIN { use_ok('XS::APItest') };
5 #########################
9 $XS::APItest::exception_caught = undef;
11 $rv = eval { apitest_exception(0) };
15 is($XS::APItest::exception_caught, 0);
17 $XS::APItest::exception_caught = undef;
19 $rv = eval { apitest_exception(1) };
22 is($XS::APItest::exception_caught, 1);
24 $rv = eval { mycroak("foobar\n"); 1 };
25 is($@, "foobar\n", 'croak');
28 $rv = eval { $@ = bless{}, "foo"; mycroak(undef); 1 };
29 is(ref($@), "foo", 'croak(NULL)');