From cae64007a3af3ae71530770aece64e353c690b41 Mon Sep 17 00:00:00 2001 From: Michael Pyne Date: Sat, 26 Feb 2011 22:49:07 -0500 Subject: [PATCH] Actually verify exception is thrown. The test suite comments hint around the fact that an exception should be thrown if --resume-from and --resume-after are both set, it's not actually that hard to verify an exception is raised, so go ahead and add a simple test for that. --- kdesrc-build-test.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kdesrc-build-test.pl b/kdesrc-build-test.pl index 792000f..6a1225c 100755 --- a/kdesrc-build-test.pl +++ b/kdesrc-build-test.pl @@ -275,8 +275,13 @@ set_option('global', 'resume-from', 'set1'); is_deeply(\@filtered_modules, [@ConfModules[1..$#ConfModules]], 'resume-from a module-set'); set_option('global', 'resume-after', 'set1'); -# Avoid exception from setting both resume-after and resume-from, although it -# would be good to ensure that happens too! +# Setting both resume-from and resume-after should raise an exception. +$@ = ''; +eval { + @filtered_modules = applyModuleFilters(@conf_modules); +}; +isa_ok($@, 'BuildException', 'resume-{from,after} combine for exception'); + delete $package_opts{'global'}->{'resume-from'}; @filtered_modules = applyModuleFilters(@conf_modules); is_deeply(\@filtered_modules, [@ConfModules[3..$#ConfModules]], 'resume-after a module-set');