/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. <cffunction name="test_hashing_arguments_to_identical_result">
  3. <cfset loc.result1 = _method(1,2,3,4,5,6,7,8,9)>
  4. <cfset loc.result2 = _method(1,2,3,4,5,6,7,8,9)>
  5. <cfset assert("loc.result1 IS loc.result2")>
  6. <cfset loc.result1 = _method("per", "was", "here")>
  7. <cfset loc.result2 = _method("per", "was", "here")>
  8. <cfset assert("loc.result1 IS loc.result2")>
  9. <cfset loc.result1 = _method(a=1, b=2)>
  10. <cfset loc.result2 = _method(a=1, b=2)>
  11. <cfset assert("loc.result1 IS loc.result2")>
  12. <cfset aStruct = StructNew()>
  13. <cfset aStruct.test1 = "a">
  14. <cfset aStruct.test2 = "b">
  15. <cfset anArray = ArrayNew(1)>
  16. <cfset anArray[1] = 1>
  17. <cfset loc.result1 = _method(a=aStruct, b=anArray)>
  18. <cfset loc.result2 = _method(a=aStruct, b=anArray)>
  19. <cfset assert("loc.result1 IS loc.result2")>
  20. </cffunction>
  21. <cffunction name="_method">
  22. <cfreturn $hashedKey(arguments)>
  23. </cffunction>
  24. </cfcomponent>