Last active
January 14, 2017 16:31
-
-
Save roryl/115e0f98612e1334fc94549a2d3d820b to your computer and use it in GitHub Desktop.
Lucee 5 Lambda Examples
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
myclosure = function(){ | |
return "foo" | |
} | |
echo(myClosure()); | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<cfscript> | |
myclosure = () => "foo" | |
echo(myClosure()); | |
</cfscript> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* My xUnit Test | |
*/ | |
component extends="testbox.system.BaseSpec"{ | |
/*********************************** LIFE CYCLE Methods ***********************************/ | |
// executes before all test cases | |
function beforeTests(){ | |
} | |
// executes after all test cases | |
function afterTests(){ | |
} | |
// executes before every test case | |
function setup( currentMethod ){ | |
} | |
// executes after every test case | |
function teardown( currentMethod ){ | |
} | |
/*********************************** TEST CASES BELOW ***********************************/ | |
// Remember that test cases MUST start or end with the keyword 'test' | |
function testBasicClosure() test{ | |
include template="/examples/lambdas/closure.cfm"; | |
expect(isClosure(myClosure)).toBeTrue(); | |
} | |
// Remember that test cases MUST start or end with the keyword 'test' | |
function testBasicLambda() test{ | |
include template="/examples/lambdas/lambda.cfm"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment