Skip to content

Commit

Permalink
Added to continue without a semicolon inside the script for LDEV-4268
Browse files Browse the repository at this point in the history
  • Loading branch information
cfmitrah committed Jan 30, 2024
1 parent cdc4799 commit 3510dff
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
29 changes: 29 additions & 0 deletions test/tickets/LDEV4268.cfc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
component extends="org.lucee.cfml.test.LuceeTestCase" labels="syntax" {

function beforeAll() {
variables.uri = createURI("LDEV4268");
}

function run( testResults , testBox ) {
describe( "Testcase for LDEV-4268", function() {
it( title="continue without a semicolon inside the script", body=function() {
try {
var res = _internalRequest(
template: "#variables.uri#/LDEV4268.cfm"
).filecontent.trim();
}
catch(any e) {
var res = e.message;
}

expect(res).toBe(9);
});
});
}

private string function createURI(string calledName) {
var baseURI = "/test/#listLast(getDirectoryFromPath(getCurrenttemplatepath()),"\/")#/";
return baseURI&""&calledName;
}

}
11 changes: 11 additions & 0 deletions test/tickets/LDEV4268/LDEV4268.cfm
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<cfscript>
count = 0;
for (x = 1; x <= 10; x++) {
// ignoring row 5 and continue the loop
if (x EQ 5) {
continue;
}
count++;
}
writeOutput(count);
</cfscript>

0 comments on commit 3510dff

Please sign in to comment.