From 6c375bce0d5137b78b6952db4ebb7cbfc049793d Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Thu, 7 Nov 2024 12:53:04 +0100 Subject: [PATCH] LDEV-5146 test case for expand path directory endings https://luceeserver.atlassian.net/browse/LDEV-5146 --- test/functions/ExpandPath.cfc | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/test/functions/ExpandPath.cfc b/test/functions/ExpandPath.cfc index ef3c93a2aa..2025f83a23 100644 --- a/test/functions/ExpandPath.cfc +++ b/test/functions/ExpandPath.cfc @@ -75,7 +75,33 @@ component extends="org.lucee.cfml.test.LuceeTestCase" labels="mappings" { expandPath( '/'); } - - + public void function testForDirectoryWinStyleWithPlaceholder(){ + var uid = createUniqueID(); + var trgWin=expandPath("{temp-directory}/#uid#\"); + expect(right(trgWin,1)).toBe(sep, trgWin); + expect(trgWin).toInclude(uid); + } + + public void function testForDirectoryUnixStyleWithPlaceholder(){ + var uid = createUniqueID(); + var trgUnix=expandPath("{temp-directory}/#uid#/"); + expect(right(trgUnix,1)).toBe(sep, trgUnix); + expect(trgWUnix).toInclude(uid); + } + + public void function testForDirectoryWinStyle(){ + var uid = createUniqueID(); + var trgWin=expandPath("#getTempDirectory()#/#uid#\"); + expect(right(trgWin,1)).toBe(sep, trgWin); + expect(trgWin).toInclude(uid); + } + + public void function testForDirectoryUnixStyle(){ + var uid = createUniqueID(); + var trgUnix=expandPath("#getTempDirectory()#/#uid#/"); + expect(right(trgUnix,1)).toBe(sep, trgUnix); + expect(trgUnix).toInclude(uid); + } + }