Files
yallie 9fa3874800 Added the contents of the archive.
Moved the original file to the archive subfolder.
2017-11-20 16:11:42 +03:00

997 lines
30 KiB
JavaScript

//# ==++==
//#
//#
//# Copyright (c) 2002 Microsoft Corporation. All rights reserved.
//#
//# The use and distribution terms for this software are contained in the file
//# named license.txt, which can be found in the root of this distribution.
//# By using this software in any fashion, you are agreeing to be bound by the
//# terms of this license.
//#
//# You must not remove this notice, or any other, from this software.
//#
//#
//# ==--==
//####################################################################################
@cc_on
import System;
var NULL_DISPATCH = null;
var apGlobalObj;
var apPlatform;
var lFailCount;
var iTestID = 53351;
var sCat = '';
var regPat = "";
var objExp = "";
var regExp = "";
var strTest = "";
var m_scen = '';
var strTemp = "";
function verify(sCat1, sExp, sAct)
{
//this function makes sure sAct and sExp are equal
if (sExp != sAct)
apLogFailInfo( m_scen+(sCat1.length?"--"+sCat1:"")+" failed", sExp,sAct, "");
}
function verifyStringObj(sCat1, sExp, sAct)
{
//this function simply calls verify with the values of the string
verify(sCat1, sExp.valueOf(), sAct.valueOf());
}
function ArrayEqual(sCat1, arrayExp, arrayAct)
{var i;
//Makes Sure that Arrays are equal
if (arrayAct == null)
verify(sCat1 + ' NULL Err', arrayExp, arrayAct);
else if (arrayExp.length != arrayAct.length)
verify(sCat1 + ' Array length', arrayExp.length, arrayAct.length);
else
{
for (i in arrayExp)
verify(sCat1 + ' index '+i, arrayExp[i], arrayAct[i]);
}
}
function regVerify(sCat1, arrayReg, arrayAct)
{
var i;
var expArray = new Array('','','','','','','','','');
for (i in arrayReg)
if (i < 10)
expArray[i] = arrayReg[i];
else
break;
for(i =0; i<9;i++)
verify(sCat1 + ' RegExp.$'+ (i+1) +' ', expArray[i], eval('RegExp.$'+(i+1)));
}
function rep_116() {
@if(@_fast)
var i, strTest, regExp;
@end
apInitTest("rep_116");
m_scen = ('Test 1 numbers /^234/');
apInitScenario(m_scen);
regPat = /^234/;
regExp = new Array();
objExp = 'a';
strTest = '234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = 'a7';
strTest = '2347';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = 'a7 ';
strTest = '2347 ';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = 'a ';
strTest = '234 ';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 2 Slightly more complex strings');
objExp = 'a 23 4 23924272392';
strTest = '234 23 4 23924272392';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = 'a 23 4 23924272392 ';
strTest = '234 23 4 23924272392 ';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = 'a7 23 4 239242723923 4 ';
strTest = '2347 23 4 239242723923 4 ';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 3 numbers tests w/ multiples');
objExp = 'a 234';
strTest = '234 234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = 'a 234 ';
strTest = '234 234 ';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = 'a7 2345 ';
strTest = '2347 2345 ';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 4 Slightly more complex strings w/ multiple finds');
objExp = 'a 234 23924272392';
strTest = '234 234 23924272392';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = 'a 234 23924272392 ';
strTest = '234 234 23924272392 ';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = 'a235 885723421957920 239242723925 ';
strTest = '234235 885723421957920 239242723925 ';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = 'a7 7234 23924272392 ';
strTest = '2347 7234 23924272392 ';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = 'a 234 234272392 ';
strTest = '234 234 234272392 ';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = 'a7 22323423 22234272392';
strTest = '2347 22323423 22234272392';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 5 numbers /234$/');
apInitScenario(m_scen);
regPat = /234$/;
regExp = new Array();
objExp = 'a';
strTest = '234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '7a';
strTest = '7234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' a';
strTest = ' 234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23 a';
strTest = '23 234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23 a';
strTest = '23 234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 6 Slightly more complex strings');
objExp = '274 23 4 2392427239a';
strTest = '274 23 4 2392427239234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 274 23 4 2392427239a';
strTest = ' 274 23 4 2392427239234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 7 numbers tests w/ multiples');
objExp = '234 a';
strTest = '234 234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 234 a';
strTest = ' 234 234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 23 4 234 a';
strTest = ' 23 4 234 234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 8 Slightly more complex strings w/ multiple finds');
objExp = '23 234 27 285 99 2392427239a';
strTest = '23 234 27 285 99 2392427239234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 234 27 285 99 2392427239a';
strTest = ' 234 27 285 99 2392427239234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 5927234235 885723421957920 2392427239a';
strTest = ' 5927234235 885723421957920 2392427239234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 72345 62340 52392427239a';
strTest = ' 72345 62340 52392427239234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '22347 22323423 22234272392222222222222222a';
strTest = '22347 22323423 22234272392222222222222222234';
ArrayEqual(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 9 Failure - Lowercase /^234 /');
apInitScenario(m_scen);
regPat = /^234/;
objExp = ' 234176';
strTest = ' 234176';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '7234176';
strTest = '7234176';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '723451767';
strTest = '723451767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 23451767';
strTest = ' 23451767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 2341767';
strTest = ' 2341767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 234 1767';
strTest = ' 234 1767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 7234 1767';
strTest = ' 7234 1767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23 2341767';
strTest = '23 2341767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23 2341767';
strTest = '23 2341767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23234 1767 ';
strTest = '23234 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23 2345 1767 ';
strTest = '23 2345 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23 234 1767 ';
strTest = '23 234 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '235 72345 1767 ';
strTest = '235 72345 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 10 Failure - Slightly more complex strings');
objExp = ' 2341767 23 4 23924272392';
strTest = ' 2341767 23 4 23924272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23 4 723401767 23924272392 ';
strTest = '23 4 723401767 23924272392 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 72341767 23 4 239242723923';
strTest = ' 72341767 23 4 239242723923';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '72341767 23 4 239242723923 4 ';
strTest = '72341767 23 4 239242723923 4 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 5234 23 4 23924272392';
strTest = ' 5234 23 4 23924272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '7234 1767 23 4 239242723923 7 ';
strTest = '7234 1767 23 4 239242723923 7 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 11 Failure - Lowercase tests w/ multiples');
objExp = ' 234 1767';
strTest = ' 234 1767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '7234 1767 ';
strTest = '7234 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 234 1767 ';
strTest = ' 234 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 2347 51767 ';
strTest = ' 2347 51767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 12 Failure - Slightly more complex strings w/ multiple finds');
objExp = ' 234 1767 23924272392';
strTest = ' 234 1767 23924272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 5927234235 885717671957920 239242723925';
strTest = ' 5927234235 885717671957920 239242723925';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '5927234235 885717671957920 239242723925 ';
strTest = '5927234235 885717671957920 239242723925 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 72345 61767 5239242723928';
strTest = ' 72345 61767 5239242723928';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '12347 71767 23924272392 ';
strTest = '12347 71767 23924272392 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 72347 81767 239242723927 ';
strTest = ' 72347 81767 239242723927 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '8234 31767 9234272392';
strTest = '8234 31767 9234272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 8234 31767 923924272392';
strTest = ' 8234 31767 923924272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 82349 317672 234272392';
strTest = ' 82349 317672 234272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '9234 01767 234272392 ';
strTest = '9234 01767 234272392 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 22347 223176723 22234272392';
strTest = ' 22347 223176723 22234272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '6023470 1217678 9623472272392 ';
strTest = '6023470 1217678 9623472272392 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 1123470 761767 15752342723923050 ';
strTest = ' 1123470 761767 15752342723923050 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 13 Failure - Lowercase /234$/');
apInitScenario(m_scen);
regPat = /234$/;
objExp = '234176';
strTest = '234176';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '7234176';
strTest = '7234176';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '723451767';
strTest = '723451767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23451767';
strTest = '23451767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 2341767';
strTest = ' 2341767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '234 1767';
strTest = '234 1767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '7234 1767';
strTest = '7234 1767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 234 1767';
strTest = ' 234 1767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 7234 1767';
strTest = ' 7234 1767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23 2341767';
strTest = '23 2341767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23 2341767';
strTest = '23 2341767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23234 1767 ';
strTest = '23234 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23 2345 1767 ';
strTest = '23 2345 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23 234 1767 ';
strTest = '23 234 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '235 72345 1767 ';
strTest = '235 72345 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 14 Failure - Slightly more complex strings');
objExp = '2341767 23 4 23924272392';
strTest = '2341767 23 4 23924272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 2341767 23 4 23924272392';
strTest = ' 2341767 23 4 23924272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '23 4 723401767 23924272392 ';
strTest = '23 4 723401767 23924272392 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 72341767 23 4 239242723923';
strTest = ' 72341767 23 4 239242723923';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '72341767 23 4 239242723923 4 ';
strTest = '72341767 23 4 239242723923 4 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 5234 23 4 23924272392';
strTest = ' 5234 23 4 23924272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '7234 1767 23 4 239242723923 7 ';
strTest = '7234 1767 23 4 239242723923 7 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 15 Failure - Lowercase tests w/ multiples');
objExp = '234 1767';
strTest = '234 1767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 234 1767';
strTest = ' 234 1767';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '234 1767 ';
strTest = '234 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '7234 1767 ';
strTest = '7234 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 234 1767 ';
strTest = ' 234 1767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 2347 51767 ';
strTest = ' 2347 51767 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
m_scen = ('Test 16 Failure - Slightly more complex strings w/ multiple finds');
objExp = '234 1767 23924272392';
strTest = '234 1767 23924272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 234 1767 23924272392';
strTest = ' 234 1767 23924272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '234 1767 23924272392 ';
strTest = '234 1767 23924272392 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 5927234235 885717671957920 239242723925';
strTest = ' 5927234235 885717671957920 239242723925';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '5927234235 885717671957920 239242723925 ';
strTest = '5927234235 885717671957920 239242723925 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 72345 61767 5239242723928';
strTest = ' 72345 61767 5239242723928';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '12347 71767 23924272392 ';
strTest = '12347 71767 23924272392 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 72347 81767 239242723927 ';
strTest = ' 72347 81767 239242723927 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '8234 31767 9234272392';
strTest = '8234 31767 9234272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 8234 31767 923924272392';
strTest = ' 8234 31767 923924272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '234 1767 234272392 ';
strTest = '234 1767 234272392 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 82349 317672 234272392';
strTest = ' 82349 317672 234272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '9234 01767 234272392 ';
strTest = '9234 01767 234272392 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 22347 223176723 22234272392';
strTest = ' 22347 223176723 22234272392';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = '6023470 1217678 9623472272392 ';
strTest = '6023470 1217678 9623472272392 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
objExp = ' 1123470 761767 15752342723923050 ';
strTest = ' 1123470 761767 15752342723923050 ';
verify(sCat+strTest, objExp, strTest.replace(regPat, "a"));
@if (!@_fast)
regVerify(sCat+strTest, regExp, strTest.replace(regPat, "a"));
@end
/*****************************************************************************/
apEndTest();
}
rep_116();
if(lFailCount >= 0) System.Environment.ExitCode = lFailCount;
else System.Environment.ExitCode = 1;
function apInitTest(stTestName) {
lFailCount = 0;
apGlobalObj = new Object();
apGlobalObj.apGetPlatform = function Funca() { return "Rotor" }
apGlobalObj.LangHost = function Funcb() { return 1033;}
apGlobalObj.apGetLangExt = function Funcc(num) { return "EN"; }
apPlatform = apGlobalObj.apGetPlatform();
var sVer = "1.0"; //navigator.appVersion.toUpperCase().charAt(navigator.appVersion.toUpperCase().indexOf("MSIE")+5);
apGlobalObj.apGetHost = function Funcp() { return "Rotor " + sVer; }
print ("apInitTest: " + stTestName);
}
function apInitScenario(stScenarioName) {print( "\tapInitScenario: " + stScenarioName);}
function apLogFailInfo(stMessage, stExpected, stActual, stBugNum) {
lFailCount = lFailCount + 1;
print ("***** FAILED:");
print ("\t\t" + stMessage);
print ("\t\tExpected: " + stExpected);
print ("\t\tActual: " + stActual);
}
function apGetLocale(){ return 1033; }
function apWriteDebug(s) { print("dbg ---> " + s) }
function apEndTest() {}