-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2289 from MitrahSoft/LDEV-4771
Added testcase for call a function with cfloop query in LDEV-4771
- Loading branch information
Showing
2 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
component extends="org.lucee.cfml.test.LuceeTestCase" skip=true { | ||
|
||
function beforeAll(){ | ||
variables.uri = createURI("LDEV4771"); | ||
} | ||
function run( testResults , testBox ) { | ||
describe( "test case for LDEV-4771", function() { | ||
it( title="checking to call a function with cfloop query", body=function( currentSpec ) { | ||
var result = _InternalRequest( | ||
template : "#uri#\LDEV4771.cfm" | ||
); | ||
expect( result.filecontent ).toBe("2221"); | ||
}); | ||
}); | ||
} | ||
|
||
private string function createURI(string calledName){ | ||
var baseURI="/test/#listLast(getDirectoryFromPath(getCurrenttemplatepath()),"\/")#/"; | ||
return baseURI&""&calledName; | ||
} | ||
|
||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<cfscript> | ||
qry = queryNew("id", "integer", [1]); | ||
function f0(id) { | ||
var a = [10]; | ||
a.each(function(item){ | ||
writeOutput(id); | ||
var b = [20]; | ||
b.each(function(item){ | ||
writeOutput(id); | ||
}); | ||
}); | ||
var f1 = function(){return id;} | ||
writeOutput(f1() ); | ||
f2(); | ||
} | ||
function f2() { | ||
writeOutput(id); | ||
} | ||
cfloop (query=qry ) { | ||
writeOutput(f0(id = 2)); | ||
}; | ||
</cfscript> |