Re: Test::Exception and XS code

2005-08-15 Thread Sébastien Aperghis-Tramoni
Yitzchak Scott-Thoennes wrote: The throw_ok { ... } syntax only works because the throw_ok sub exists and has a prototype that specifies a subref is expected; if you don't load Test::Exception by the time the throw_ok call is compiled, it is parsed as an indirect object call of the "throw_ok" me

Re: Test::Exception and XS code

2005-08-15 Thread Yitzchak Scott-Thoennes
On Mon, Aug 15, 2005 at 05:58:23PM +0200, S?bastien Aperghis-Tramoni wrote: > use strict; > use Test::More tests => 2; > use Test::Exception; > use Net::Pcap; > > throws_ok( > sub { Net::Pcap::lookupdev() }, > '/^Usage: Net::Pcap::lookupdev\(err\)/', > "

Re: Test::Exception and XS code

2005-08-15 Thread Sébastien Aperghis-Tramoni
Sébastien Aperghis-Tramoni wrote: While rewriting Net::Pcap test suite, I quickly stumbled upon this problem: it looks like Test::Exception can't catch croak() or die() thrown from XS code. [...] Ok, I corrected a mistake (I was using dies_ok() instead of throws_ok()), and reduced the probl

Re: Test::Exception and XS code

2005-08-15 Thread Bjoern Hoehrmann
* Sébastien Aperghis-Tramoni wrote: >While rewriting Net::Pcap test suite, I quickly stumbled upon this >problem: it looks like Test::Exception can't catch croak() or die() >thrown from XS code. Here is an example: http://spo.sf.net uses Test::Exception and croak() and things seem to work for me

Test::Exception and XS code

2005-08-15 Thread Sébastien Aperghis-Tramoni
Hello all, I have posted this question on CPAN Forum but nobody answered, so I also post it here in case someone has an idea. While rewriting Net::Pcap test suite, I quickly stumbled upon this problem: it looks like Test::Exception can't catch croak() or die() thrown from XS code. Here is an