App-Test-Generator

 view release on metacpan or  search on metacpan

t/Analyzer-Complexity.t  view on Meta::CPAN

	is($report->{exception_paths}, 1, 'croak: one exception path');

	# confess
	$report = _analyze_body('confess "deep error";');
	is($report->{exception_paths}, 1, 'confess: one exception path');

	# eval block
	$report = _analyze_body('eval { do_something(); };');
	is($report->{exception_paths}, 1, 'eval: one exception path');

	# try/catch (e.g. Try::Tiny style)
	$report = _analyze_body('try { do_something(); } catch { handle($_); };');
	is($report->{exception_paths}, 2, 'try + catch: two exception paths');

	# Multiple exception keywords are additive
	$report = _analyze_body('eval { die "err"; }');
	is($report->{exception_paths}, 2, 'eval + die: two exception paths');

	done_testing();
};



( run in 1.658 second using v1.01-cache-2.11-cpan-5fbc6bb55f2 )