[svn:parrot] r41770 - branches/detect_llvm/t/steps/auto

jkeenan at svn.parrot.org jkeenan at svn.parrot.org
Fri Oct 9 03:07:02 UTC 2009


Author: jkeenan
Date: Fri Oct  9 03:07:02 2009
New Revision: 41770
URL: https://trac.parrot.org/parrot/changeset/41770

Log:
Add tests to improve coverage of internal sub _handle_result().

Modified:
   branches/detect_llvm/t/steps/auto/llvm-01.t

Modified: branches/detect_llvm/t/steps/auto/llvm-01.t
==============================================================================
--- branches/detect_llvm/t/steps/auto/llvm-01.t	Fri Oct  9 02:54:33 2009	(r41769)
+++ branches/detect_llvm/t/steps/auto/llvm-01.t	Fri Oct  9 03:07:02 2009	(r41770)
@@ -5,7 +5,7 @@
 
 use strict;
 use warnings;
-use Test::More tests =>  27;
+use Test::More qw(no_plan); # tests =>  27;
 use Carp;
 use lib qw( lib t/configure/testlib );
 use_ok('config::init::defaults');
@@ -75,6 +75,20 @@
     }
 }
 
+$step->set_result( undef );
+$conf->data->set( 'has_llvm' => undef );
+auto::llvm::_handle_result($step, $conf, 1);
+is( $step->result(), 'yes', "Got expected 'yes' result" );
+ok( $conf->data->get( 'has_llvm' ),
+    "'has_llvm' set to true value, as expected" );
+
+$step->set_result( undef );
+$conf->data->set( 'has_llvm' => undef );
+auto::llvm::_handle_result($step, $conf, 0);
+is( $step->result(), 'no', "Got expected 'no' result" );
+ok( ! $conf->data->get( 'has_llvm' ),
+    "'has_llvm' set to false  value, as expected" );
+
 $conf->cc_clean();
 
 pass("Completed all tests in $0");


More information about the parrot-commits mailing list