Skip to content

Commit

Permalink
LDEV-5178 update test case for regression with preciseMath=false
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Dec 4, 2024
1 parent c6bc6c1 commit d1b0d1d
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion test/tickets/LDEV2793.cfc
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
component extends="org.lucee.cfml.test.LuceeTestCase" labels="java" {

function beforeAll(){
variables.preciseMath = getApplicationSettings().preciseMath;
};

function afterAll(){
application action="update" precisemath=variables.preciseMath;
};

function run( testResults , testBox ) {
describe( title='LDEV-2793' , body=function(){
beforeEach( function(){
Expand All @@ -9,7 +17,35 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="java" {
afterEach( function(){
setTimeZone(variables.startingTZ?:"UTC");
});
it( title='test parseDateTime ' , body=function() {
it( title='test parseDateTime (preciseMath=true)' , body=function() {
application action="update" preciseMath=true;
var projects = [
{
id: 1,
name: "Really old project",
createdAt: createDate( 2015, 12, 15 ).getTime() // 1450155600000
},
{
id: 500,
name: "Recent project",
createdAt: createDate( 2019, 10, 30 ).getTime() // 1572408000000
},
{
id: 1000,
name: "Current project",
createdAt: createDate( 2020, 02, 26 ).getTime() // 1582693200000
}
];
projects.sort(
( a, b ) => {
return( b.createdAt - a.createdAt );
}
);

});

it( title='test parseDateTime (preciseMath=false)', skip=true, body=function() {
application action="update" preciseMath=false;
var projects = [
{
id: 1,
Expand All @@ -27,6 +63,7 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="java" {
createdAt: createDate( 2020, 02, 26 ).getTime() // 1582693200000
}
];
// errors, see LDEV-5178
projects.sort(
( a, b ) => {
return( b.createdAt - a.createdAt );
Expand Down

0 comments on commit d1b0d1d

Please sign in to comment.