Skip to content

Commit

Permalink
LDEV-5023 improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Jul 16, 2024
1 parent abdcbf8 commit d71b45a
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions test/tickets/LDEV5023.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="qoq" skip=true {
describe( title='QofQ' , body=function(){

it( title='QoQ select * from table same source table name HSQLDB', body=function() {
var q = extensionList();
var q = getDummyData();
var cols = replaceNoCase( q.columnList, ",unique", "" ); // cleanup reserved word
// native engine
cols = "name, id";
Expand All @@ -26,7 +26,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="qoq" skip=true {
});

it( title='QoQ select * from table same source table name (arguments) HSQLDB', body=function() {
var q = extensionList();
var q = getDummyData();
var cols = replaceNoCase( q.columnList, ",unique", "" ); // cleanup reserved word
// native engine
cols = "name, id";
Expand All @@ -41,14 +41,13 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="qoq" skip=true {
sql = "SELECT t1.name FROM q_native t1, arguments.q_native t2 WHERE t1.id = t2.id",
options = { dbtype: 'query' }
);
systemOutput( q_hsqlb, true );
expect( q_stash.recordcount ).toBe( q_hsqlb.recordcount );
expect( q_native.recordcount ).toBe( q_hsqlb.recordcount );
expect( q_stash.recordcount ).toBe( q_native.recordcount );
});

it( title='QoQ select * from table same source table name (all cols) HSQLDB', body=function() {
var q = extensionList();
var q = getDummyData();
var cols = replaceNoCase( q.columnList, ",unique", "" ); // cleanup reserved word
// native engine
var q_native = QueryExecute(
Expand All @@ -61,7 +60,6 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="qoq" skip=true {
sql = "SELECT t1.name FROM q_native t1, q_native t2 WHERE t1.id = t2.id",
options = { dbtype: 'query' }
);
systemOutput( q_hsqlb, true );
expect( q_stash.recordcount ).toBe( q_hsqlb.recordcount );
expect( q_native.recordcount ).toBe( q_hsqlb.recordcount );
expect( q_stash.recordcount ).toBe( q_native.recordcount );
Expand All @@ -72,7 +70,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="qoq" skip=true {
var arr = [];
ArraySet(arr, 1, 1000, 0);
arrayEach(arr, function(){
var q = extensionList();
var q = getDummyData();
var cols = replaceNoCase( q.columnList, ",unique", "" ); // cleanup reserved word
// native engine
q = QueryExecute(
Expand All @@ -91,4 +89,17 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="qoq" skip=true {

}

private function getDummyData(){
var q = queryNew("id,name,data","integer,varchar, varchar");
loop times=100 {
loop list="micha,zac,brad,pothys,gert" item="local.n" index="local.i" {
var r = queryAddRow( q );
querySetCell(q, "id", r, r)
querySetCell(q, "name", n, r)
//querySetCell(q, "data", repeatString("lucee",1000), r);
}
}
return q;
}

}

0 comments on commit d71b45a

Please sign in to comment.