add:   if( obj != null ) { for( member in obj ) { var r = /test(\w+)/; if( r.exec( member )) this.addTest( eval( "new " + name + "Test( \"" + member + "\" )")); } obj = null; } 
context: function TestSuite( name ){	this._super = Test;	this._super( name );	this.mTests = new Array();	/**	 * @@method	 * Add a test to the suite.	 * @param test The test to add.	 */	function addTest( test ) 	{ 		this.mTests[this.mTests.length] = test; 	}	/**	 * @@method Number	 * Counts the number of test cases that will be run by this test suite.	 * @return The number of test cases.	 */	function countTestCases()	{		var tests = 0;		for( var i = 0; i < this.testCount(); ++i )			tests += this.mTests[i].countTestCases();		return tests;	}	/**	 * @@method String	 * Search a test by name.	 * The function compares the given name with the name of the test and 	 * returns its own instance if the name is equal.	 * @param name The name of the searched test.	 * @return The instance itself of null.	 */	function findTest( name )	{		if( name == this.mName )			return this;		for( var i = 0; i < this.testCount(); ++i )		{			var test = this.mTests[i].findTest( name );			if( test != null )				return test;		}		return null;	}	/**	 * @@method	 * Runs a test and collects its result in a TestResult instance.	 * @param result The test result to fill.	 */	function run( result )	{		--result.mRunTests;		result.startTest( this );		this.setUp();		for( var i = 0; i < this.testCount(); ++i )		{			if( result.shouldStop())				break;			this.mTests[i].run( result );		}		this.tearDown();		if( i == 0 )		{			var ex = new AssertionFailedError( 				"Test suite with no tests.", new CallStack());			result.addFailure( this, ex );		}		result.endTest( this );	}	/**	 * @@method	 * Set up the environment of the test suite.	 */	function setUp() {}	/**	 * @@method	 * Clear up the environment of the test suite.	 */	function tearDown() {}	/**	 * @@method Number	 * Returns the number of tests in this suite.	 */	function testCount() { return this.mTests.length; }	this.addTest = addTest;	this.countTestCases = countTestCases;	this.findTest = findTest;	this.run = run;	this.setUp = setUp;	this.tearDown = tearDown;	this.testCount = testCount;}
meta: 1373	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1373/268c8f734f9f87a02f268a9cf7f0d02c387404c9/JsUnit.js/buggy/jsunit/lib/JsUnit.js