PageRenderTime 82ms CodeModel.GetById 41ms app.highlight 0ms RepoModel.GetById 40ms app.codeStats 0ms

/wheels/tests/global/caching.cfc

http://cfwheels.googlecode.com/
ColdFusion CFScript | 27 lines | 24 code | 3 blank | 0 comment | 0 complexity | 72d0452b631d18ae253305c7dfc2cd39 MD5 | raw file
 1<cfcomponent extends="wheelsMapping.Test">
 2
 3	<cffunction name="test_hashing_arguments_to_identical_result">
 4		<cfset loc.result1 = _method(1,2,3,4,5,6,7,8,9)>
 5		<cfset loc.result2 = _method(1,2,3,4,5,6,7,8,9)>
 6		<cfset assert("loc.result1 IS loc.result2")>
 7		<cfset loc.result1 = _method("per", "was", "here")>
 8		<cfset loc.result2 = _method("per", "was", "here")>
 9		<cfset assert("loc.result1 IS loc.result2")>
10		<cfset loc.result1 = _method(a=1, b=2)>
11		<cfset loc.result2 = _method(a=1, b=2)>
12		<cfset assert("loc.result1 IS loc.result2")>
13		<cfset aStruct = StructNew()>
14		<cfset aStruct.test1 = "a">
15		<cfset aStruct.test2 = "b">
16		<cfset anArray = ArrayNew(1)>
17		<cfset anArray[1] = 1>
18		<cfset loc.result1 = _method(a=aStruct, b=anArray)>
19		<cfset loc.result2 = _method(a=aStruct, b=anArray)>
20		<cfset assert("loc.result1 IS loc.result2")>
21	</cffunction>
22
23	<cffunction name="_method">
24		<cfreturn $hashedKey(arguments)>
25	</cffunction>
26
27</cfcomponent>