File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed
Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change 11component extends = " org.lucee.cfml.test.LuceeTestCase" labels = " esapi" {
2- function run ( testResults , testBox ) {
3- describe ( " test case for EncodeForJavascript" , function () {
4- it (title = " Checking with EncodeForJavascript" , body = function ( currentSpec ) {
5- var enc = EncodeForJavascript (' <script>' );
6- assertEquals (' \x3Cscript\x3E' ,enc );
7- });
8- it (title = " Checking with EncodeForJavascriptMember" , body = function ( currentSpec ) {
9- var enc = ' <script>' .EncodeForJavascript ();
10- assertEquals (' \x3Cscript\x3E' ,enc );
11- });
12- });
13- }
2+ function run ( testResults , testBox ) {
3+ describe ( " test case for EncodeForJavascript" , function () {
4+ it (title = " Checking with EncodeForJavascript" , body = function ( currentSpec ) {
5+ // Testing a single quote which both libraries escape as \x27
6+ var enc = EncodeForJavascript (" '" );
7+ assertEquals (' \x27' , enc );
8+ });
9+ it (title = " Checking with EncodeForJavascriptMember" , body = function ( currentSpec ) {
10+ var enc = " '" .EncodeForJavascript ();
11+ assertEquals (' \x27' , enc );
12+ });
13+ });
14+ }
1415}
You can’t perform that action at this time.
0 commit comments