<commit_before><cfparam name="params.type" default="core">
<cfset packages = $createObjectFromRoot(path=application.wheels.wheelsComponentPath, fileName="Test", method="$listTestPackages", options=params)>
<cfset linkParams = "?controller=wheels&action=wheels&view=tests&type=#params.type#">
<cfoutput>
<p><a href="#linkParams#" target="_blank">Run All Tests</a> | <a href="#linkParams#&reload=true" target="_blank">Reload Test Data</a></p>
<h1>#titleize(params.type)# Test Packages</h1>
<p>Below is listing of all the #params.type# test packages. Click the part of the package to run it individually.</p>
<cfif params.type is "core">
	<cfset strip = "wheels.tests">
<cfelseif params.type is "app">
	<cfset strip = "tests.">
<cfelse><!--- assumed to be a plugin --->
	<cfset strip = "plugins.#params.type#.tests.">
</cfif>
<cfloop query="packages">
	<p>
		<cfset a = ListToArray(ReplaceNoCase(package, strip, "", "one"), ".")>
		<cfset b = createObject("java", "java.util.ArrayList").Init(a)>
		<cfset c = arraylen(a)>
		<cfloop from="1" to="#c#" index="i">
			<cfset href = "#linkParams#&package=#ArrayToList(b.subList(JavaCast('int', 0), JavaCast('int', i)), '.')#">
			<a href="#href#" target="_blank">#a[i]#</a><cfif i neq c> .</cfif>
		</cfloop>
	</p>
</cfloop>
</cfoutput><commit_msg>fix #533 Don't show parent folders as test packages<commit_after><cfparam name="params.type" default="core">
<cfset packages = $createObjectFromRoot(path=application.wheels.wheelsComponentPath, fileName="Test", method="$listTestPackages", options=params)>
<cfset linkParams = "?controller=wheels&action=wheels&view=tests&type=#params.type#">
<!--- ignore packages before the "tests directory" --->
<cfif packages.recordCount>
	<cfset allPackages = ListToArray(packages.package, ".")>
	<cfset foundAt = ArrayFindNoCase(allPackages, "tests")>
	<cfset preTest = "">
	<cfloop from="1" to="#foundAt#" index="i">
		<cfset preTest = ListAppend(preTest, allPackages[i], ".")>
	</cfloop>
</cfif>
<cfoutput>
<p><a href="#linkParams#" target="_blank">Run All Tests</a> | <a href="#linkParams#&reload=true" target="_blank">Reload Test Data</a></p>
<h1>#titleize(params.type)# Test Packages</h1>
<p>Below is listing of all the #params.type# test packages. Click the part of the package to run it individually.</p>
<cfloop query="packages">
	<p>
		<cfset testablePackages = ListToArray(ReplaceNoCase(package, "#preTest#.", "", "one"), ".")>
		<cfset packagesLen = arrayLen(testablePackages)>
		<cfloop from="1" to="#packagesLen#" index="i">
			<cfset href = "#linkParams#&package=#ArrayToList(testablePackages.subList(JavaCast('int', 0), JavaCast('int', i)), '.')#">
			<a href="#href#" target="_blank">#testablePackages[i]#</a><cfif i neq packagesLen> .</cfif>
		</cfloop>
	</p>
</cfloop>
</cfoutput>
{'fraction_non_alphanumeric': 0.20273676629456247, 'fraction_numerical': 0.004321209938782859, 'mean_word_length': 6.528455284552845, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 77, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1523485', 'n_tokens_mistral': 1008, 'n_tokens_neox': 986, 'n_words': 216}