Skip to content

Commit

Permalink
LDEV-5210 add tests for currentrow cursor with debug pageParts query
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Dec 18, 2024
1 parent 982c5e6 commit 082d83c
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/tickets/LDEV5206.cfc
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,21 @@ component extends = "org.lucee.cfml.test.LuceeTestCase" {
expect( pageParts[ key ].snippet ).toBe( "sleep(5)" );
});
});

describe( "LDEV-5210 DebugExecutionLog loop requires currentrow", function(){
xit( "LDEV-5210 test DebugExecutionLog - currentrow required ", function(){
var logs = getDebugLogs();
expect( len( logs ) ).toBe( 1 );
var log = logs[ 1 ];
expect( log ).toHaveKey( "pageParts" );
var pageParts = log.pageParts;
expect( pageParts ).toBeQuery();
//systemOutput( pageParts.toString(), true );
pageParts = _toPartsStructNoCurrentrow( pageParts );
expect( pageParts.row[1] ).toBe( 1 ); // returns ""
//systemOutput( pageParts.toString(), true );
});
});
}

private string function createURI( string calledName ){
Expand Down Expand Up @@ -125,6 +140,21 @@ component extends = "org.lucee.cfml.test.LuceeTestCase" {
return st;
}

// currentrow required LDEV-5210
private function _toPartsStructNoCurrentrow( query pageParts ){
var parts = duplicate( pageParts );
queryAddColumn( parts, "row" );
var r = 0;
loop query=parts {
var r++;
querySetCell( parts, "row", r );
}
loop list="path,min,max,avg,count,total,id,start,end,snippet" item="local.col" {
queryDeleteColumn(parts, col);
}
return parts;
}

function getDebugLogs() cachedwithin="request" {
disableExecutionLog();
enableExecutionLog( "lucee.runtime.engine.DebugExecutionLog",{
Expand Down

0 comments on commit 082d83c

Please sign in to comment.