<commit_before><cfcomponent>
	<cffunction name="run" returntype="WEB-INF.cftags.component" access="public" output="true" hint="Primary method for running TestSuites and individual tests.">
		<cfargument name="suite" />
		<cfargument name="results" hint="The TestResult collecting parameter." required="no" type="TestResult" default="#createObject("component","TestResult").TestResult()#" />
		<cfargument name="testMethod" hint="A single test method to run." type="string" required="no" default="">
		<cfargument name="requestScopeDebuggingEnabled" />    
		
		<cfset var methods = ArrayNew(1)>
		<cfset var o = "">
		<cfset var start = "">
		<cfset var end = "">
		<cfset var componentIndex = 0>
		<cfset var methodIndex = 0>
		<cfset var methodName = "">
		<cfset var expectedExceptionType = "" />
		<cfset var components = structKeyArray(suite.suites()) />    
		<cfset var outputOfTest = "" />
		
		<!---  Returns a structure corresponding to the key/componentName --->
		<cfset var originalSuites = suite.suites() />
		
		<!--- top-level exception is always event name / expression for Application.cfc (but not fusebox5.cfm) --->
		<cfset var caughtException = "" />
		
		<cfloop from="1" to="#arrayLen(components)#" index="componentIndex">
			<cfset suite.suites = structFind(originalSuites, components[componentIndex] ) />
			
			<cfif len(arguments.testMethod)>
				<cfset methods[1] = arguments.testMethod />
			<cfelse>
				<cfset methods = structFind(suite.suites, "methods") />
			</cfif>
			
			<cfset componentObject = structFind(suite.suites,"ComponentObject") />
			
			<cfif isSimpleValue(componentObject)>
				<cfset o = createObject("component", components[componentIndex]).TestCase(componentObject) />
			<cfelse>
				<cfset o = componentObject.TestCase(componentObject) />
			</cfif>
			
			<!--- set the MockingFramework if one has been set for the TestSuite --->
			<cfif len(suite.MockingFramework)>
				<cfset o.setMockingFramework(suite.MockingFramework) />
			</cfif>
			
			<!--- Invoke prior to tests. Class-level setUp --->
			<cfset o.beforeTests() />
			
			<cfloop from="1" to="#arrayLen(methods)#" index="methodIndex">
				<cfset methodName = methods[methodIndex] />
				<cfset outputOfTest = "">
				<cfset  start = getTickCount() />
				
				<cfset expectedExceptionType = o.getAnnotation(methodName,"expectedException") />
				
				<cftry>
					<cfset  results.startTest(methodName,components[componentIndex]) />
					
					<cfset o.clearClassVariables() />
					<cfset o.initDebug() />
					<cfif requestScopeDebuggingEnabled OR structKeyExists(url,"requestdebugenable")>
						<cfset o.createRequestScopeDebug() />
					</cfif>
					
					<cfset o.setUp()/>
					                                                       
					<!--- 
						ATTENTION: This is where the test method is run. The following line is the center of the MXUnit universe.
					--->
					<cfset outputOfTest = runTest(o, methodName, suite.dataProviderHandler) />
					            
					<cfset assertExpectedExceptionTypeWasThrown(expectedExceptionType) />
	
	 				<cfset  results.addSuccess('Passed') />
					<!--- Add the trace message from the TestCase instance --->
					<cfset  results.addContent(outputOfTest) /> 
  			
					<cfcatch type="mxunit.exception.AssertionFailedError">
						<cfset addFailureToResults(results=results,expected=expectedExceptionType,actual=o.actual,exception=cfcatch,content=outputOfTest)>
					</cfcatch>
					
					<cfcatch type="any">
						<cfset handleCaughtException(rootOfException(cfcatch), expectedExceptionType, results, outputOfTest, o)>
					</cfcatch>
				</cftry>
				
				<cftry>
					<cfset o.tearDown() />
					
					<cfcatch type="any">
						<cfset results.addError(cfcatch)>
					</cfcatch>
				</cftry>
				
				<!--- add the deubg array to the test result item --->
				<cfset  results.setDebug( o.getDebug()) />
				
				<!---  make sure the debug buffer is reset for the next text method  --->
				<cfset  o.clearDebug()  />
				
				<!--- reset the trace message.Bill 6.10.07 --->
				<cfset o.traceMessage="" />
				<cfset end = getTickCount() />
				<cfset results.addProcessingTime(end-start) />
				<cfset results.endTest(methodName) />
			</cfloop>
			
			<!--- Invoke prior to tests. Class-level setUp --->
			<cfset o.afterTests()>
		</cfloop>
		
		<cfset results.closeResults() /><!--- Get correct time run for suite --->
		
		<cfreturn results />
	</cffunction>   
	                  
	<cffunction name="runTest" access="private">
		<cfargument name="o" /> 
		<cfargument name="methodName"/>
		<cfargument name="dataproviderHandler" />
		<cfset var outputOfTest = "" />       
		<cfset var dpName = "" />
		<cfsavecontent variable="outputOfTest">
				<cfset dpName = o.getAnnotation(methodName,"dataprovider") />
				
				<cfif len(dpName) gt 0>
					<cfset o._$snif = _$snif />
					<cfset dataProviderHandler.init(o._$snif()) /><commit_msg>Tiny tweaks to how the start end times of a test are recorded. Eliminated a variable.<commit_after><cfcomponent>
	<cffunction name="run" returntype="WEB-INF.cftags.component" access="public" output="true" hint="Primary method for running TestSuites and individual tests.">
		<cfargument name="suite" />
		<cfargument name="results" hint="The TestResult collecting parameter." required="no" type="TestResult" default="#createObject("component","TestResult").TestResult()#" />
		<cfargument name="testMethod" hint="A single test method to run." type="string" required="no" default="">
		<cfargument name="requestScopeDebuggingEnabled" />    
		
		<cfset var methods = ArrayNew(1)>
		<cfset var o = "">
		<cfset var tickCountAtStart = 0>
		<cfset var componentIndex = 0>
		<cfset var methodIndex = 0>
		<cfset var methodName = "">
		<cfset var expectedExceptionType = "" />
		<cfset var components = structKeyArray(suite.suites()) />    
		<cfset var outputOfTest = "" />
		
		<!---  Returns a structure corresponding to the key/componentName --->
		<cfset var originalSuites = suite.suites() />
		
		<!--- top-level exception is always event name / expression for Application.cfc (but not fusebox5.cfm) --->
		<cfset var caughtException = "" />
		
		<cfloop from="1" to="#arrayLen(components)#" index="componentIndex">
			<cfset suite.suites = structFind(originalSuites, components[componentIndex] ) />
			
			<cfif len(arguments.testMethod)>
				<cfset methods[1] = arguments.testMethod />
			<cfelse>
				<cfset methods = structFind(suite.suites, "methods") />
			</cfif>
			
			<cfset componentObject = structFind(suite.suites,"ComponentObject") />
			
			<cfif isSimpleValue(componentObject)>
				<cfset o = createObject("component", components[componentIndex]).TestCase(componentObject) />
			<cfelse>
				<cfset o = componentObject.TestCase(componentObject) />
			</cfif>
			
			<!--- set the MockingFramework if one has been set for the TestSuite --->
			<cfif len(suite.MockingFramework)>
				<cfset o.setMockingFramework(suite.MockingFramework) />
			</cfif>
			
			<!--- Invoke prior to tests. Class-level setUp --->
			<cfset o.beforeTests() />
			
			<cfloop from="1" to="#arrayLen(methods)#" index="methodIndex">
				<cfset methodName = methods[methodIndex] />
				<cfset outputOfTest = "">
				<cfset  tickCountAtStart = getTickCount() />
				
				<cfset expectedExceptionType = o.getAnnotation(methodName,"expectedException") />
				
				<cftry>
					<cfset  results.startTest(methodName,components[componentIndex]) />
					
					<cfset o.clearClassVariables() />
					<cfset o.initDebug() />
					<cfif requestScopeDebuggingEnabled OR structKeyExists(url,"requestdebugenable")>
						<cfset o.createRequestScopeDebug() />
					</cfif>
					
					<cfset o.setUp()/>
					                                                       
					<!--- 
						ATTENTION: This is where the test method is run. The following line is the center of the MXUnit universe.
					--->
					<cfset outputOfTest = runTest(o, methodName, suite.dataProviderHandler) />
					            
					<cfset assertExpectedExceptionTypeWasThrown(expectedExceptionType) />
	
	 				<cfset  results.addSuccess('Passed') />
					<!--- Add the trace message from the TestCase instance --->
					<cfset  results.addContent(outputOfTest) /> 
  			
					<cfcatch type="mxunit.exception.AssertionFailedError">
						<cfset addFailureToResults(results=results,expected=expectedExceptionType,actual=o.actual,exception=cfcatch,content=outputOfTest)>
					</cfcatch>
					
					<cfcatch type="any">
						<cfset handleCaughtException(rootOfException(cfcatch), expectedExceptionType, results, outputOfTest, o)>
					</cfcatch>
				</cftry>
				
				<cftry>
					<cfset o.tearDown() />
					
					<cfcatch type="any">
						<cfset results.addError(cfcatch)>
					</cfcatch>
				</cftry>
				
				<!--- add the deubg array to the test result item --->
				<cfset  results.setDebug( o.getDebug()) />
				
				<!---  make sure the debug buffer is reset for the next text method  --->
				<cfset  o.clearDebug()  />
				
				<!--- reset the trace message.Bill 6.10.07 --->
				<cfset o.traceMessage="" />
				<cfset results.addProcessingTime(getTickCount()-tickCountAtStart) />
				<cfset results.endTest(methodName) />
			</cfloop>
			
			<!--- Invoke prior to tests. Class-level setUp --->
			<cfset o.afterTests()>
		</cfloop>
		
		<cfset results.closeResults() /><!--- Get correct time run for suite --->
		
		<cfreturn results />
	</cffunction>   
	                  
	<cffunction name="runTest" access="private">
		<cfargument name="o" /> 
		<cfargument name="methodName"/>
		<cfargument name="dataproviderHandler" />
		<cfset var outputOfTest = "" />       
		<cfset var dpName = "" />
		<cfsavecontent variable="outputOfTest">
				<cfset dpName = o.getAnnotation(methodName,"dataprovider") />
				
				<cfif len(dpName) gt 0>
					<cfset o._$snif = _$snif />
					<cfset dataProviderHandler.init(o._$snif()) />
{'fraction_non_alphanumeric': 0.14123951066626225, 'fraction_numerical': 0.00272975432211101, 'mean_word_length': 3.0691073632250103, 'pattern_counts': {'":': 0, '<': 199, '<?xml version=': 0, '>': 199, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5298361', 'n_tokens_mistral': 3750, 'n_tokens_neox': 3009, 'n_words': 686}