Skip to content

Commit

Permalink
LDEV-4866 improve tests
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Jun 7, 2024
1 parent 41dce3a commit bfc71b0
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions test/tickets/LDEV4866.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,36 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="query" {
function run( testResults , testBox ) {
describe( title='LDEV-4866' , body=function(){
it( title='test query parsing, /* */-' , body=function() {
```
<cfquery name="test" datasource="#ds#" params="#params#">
/* */-</cfquery>
```
doQuery("#chr(13)# /* */- ");
doQuery("#chr(13)# /* */- ");
doQuery("/* */-");
});
it( title='test query parsing, just a - whitespace' , body=function() {
```
<cfquery name="test" datasource="#ds#" params="#params#">
-
</cfquery>
```
doQuery("#chr(9)# - #chr(13)# ");
});

it( title='test query parsing, just a -' , body=function() {
```
<cfquery name="test" datasource="#ds#" params="#params#">-</cfquery>
```
doQuery("-");
});

it( title='test query parsing, just a / whitespace' , body=function() {
```
<cfquery name="test" datasource="#ds#" params="#params#">
/
</cfquery>
```
doQuery("#chr(9)# / #chr(13)# ");
});
it( title='test query parsing, just a /' , body=function() {
```
<cfquery name="test" datasource="#ds#" params="#params#">/</cfquery>
```
doQuery("/");
});
});
}

private function doQuery(sql){
try {
query name="test" datasource="#ds#" params="#params#" {
echo( sql );
}
} catch (e) {
if ( e.stackTrace.indexOf("lucee.runtime.exp.DatabaseException:") neq 0 )
rethrow;
}
}

}

0 comments on commit bfc71b0

Please sign in to comment.