From b75f7c3624dfb5e28bb3ce4c16cf5085c5bc1185 Mon Sep 17 00:00:00 2001 From: "bob%bclary.com" Date: Mon, 11 Apr 2005 03:37:52 +0000 Subject: [PATCH] Generalize test to use regular expression to prevent false failure in rhino --- js/tests/js1_5/Regress/regress-245795.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/tests/js1_5/Regress/regress-245795.js b/js/tests/js1_5/Regress/regress-245795.js index ac91d263bb5..0a20ec98897 100755 --- a/js/tests/js1_5/Regress/regress-245795.js +++ b/js/tests/js1_5/Regress/regress-245795.js @@ -51,9 +51,15 @@ if (typeof uneval != 'undefined') b=function() {}; } - expect = ' function a() { b = (function () {}); } '; + var r = / function a\(\) \{ b = \(?function \(\) \{\s*\}\)?; \} /; eval(uneval(a)); - actual = a.toString().replace(/[ \n]+/g, ' '); + + var v = a.toString().replace(/[ \n]+/g, ' '); + + printStatus("[" + v + "]"); + + expect = true; + actual = r.test(v); reportCompare(expect, actual, summary); }