Generalize test to use regular expression to prevent false failure in rhino

git-svn-id: svn://10.0.0.236/trunk@171963 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bob%bclary.com 2005-04-11 03:37:52 +00:00
parent 2f8521387d
commit 49783750da

View File

@ -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);
}