From 4cc25d936a1194de4b6c8081d395ae91d40fa7fb Mon Sep 17 00:00:00 2001 From: CF Mitrah Date: Wed, 11 Dec 2024 17:43:15 +0530 Subject: [PATCH] Added the test cases for LDEV-5173. --- test/tickets/LDEV5173.cfc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 test/tickets/LDEV5173.cfc diff --git a/test/tickets/LDEV5173.cfc b/test/tickets/LDEV5173.cfc new file mode 100644 index 0000000000..a43c847281 --- /dev/null +++ b/test/tickets/LDEV5173.cfc @@ -0,0 +1,21 @@ +component extends = "org.lucee.cfml.test.LuceeTestCase"{ + function run( testResults, testBox ){ + describe( "Test for LDEV-5173", function() { + beforeEach( function(){ + variables.startingTZ=getTimeZone(); + setTimeZone("IST"); + }); + afterEach( function(){ + setTimeZone(variables.startingTZ?:"UTC"); + }); + it( title="parseDateTime with format 'epoch'", body=function( currentSpec ) { + date = DateTimeFormat( datetime="2024/12/11 16:19:54", mask="epoch" ); + expect(toString(parseDateTime(date=date, format="epoch"))).toBe("{ts '2024-12-11 16:19:54'}"); + }); + it( title="parseDateTime with format 'epochms'", body=function( currentSpec ) { + date = DateTimeFormat( datetime="2024/12/11 16:19:54", mask="epochms" ); + expect(toString(parseDateTime(date=date, format="epochms"))).toBe("{ts '2024-12-11 16:19:54'}"); + }); + } ); + } +} \ No newline at end of file