From 8ec08169f44685dccc0323fff4a1173603988005 Mon Sep 17 00:00:00 2001 From: Saravanamuthu Aka CF Mitrah Date: Fri, 15 Dec 2023 13:54:46 +0530 Subject: [PATCH] Added a testcase in canonicalize() function with % symbol for LDEV-4743 (#11) * Added a testcase in canonicalize() function with % symbol for LDEV-4743 * Disabled the testcase --- tests/LDEV4743.cfc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/LDEV4743.cfc diff --git a/tests/LDEV4743.cfc b/tests/LDEV4743.cfc new file mode 100644 index 0000000..9d0b33e --- /dev/null +++ b/tests/LDEV4743.cfc @@ -0,0 +1,14 @@ +component extends="org.lucee.cfml.test.LuceeTestCase" labels="esapi" skip=true { + function run( testResults , testBox ) { + describe( title='Testcase for LDEV-4743' , body=function() { + it( title='Checking canonicalize() function with % symbol' , body=function() { + expect( canonicalize("Lucee", false, false) ).toBe( "Lucee" ); + expect( canonicalize("!@##$^&*()_+{}[]:"";''<>, .?/|\~`.", false, false) ).toBe( "!@##$^&*()_+{}[]:"";''<>, .?/|\~`." ); + expect( function() { + var str = '(80 - 100%).pdf'; // Only failed with the '%' symbol + canonicalize(str, false, false); + }).notToThrow(); + }); + }); + } +}