[webkit-changes] cvs commit: WebCore/layout-tests/fast/js string_replace-expected.txt string_replace.html

Adele adele at opensource.apple.com
Tue Jun 21 16:02:08 PDT 2005


adele       05/06/21 16:02:08

  Modified:    .        ChangeLog
  Added:       layout-tests/fast/js string_replace-expected.txt
                        string_replace.html
  Log:
          Test cases for:
          <http://bugzilla.opendarwin.org/show_bug.cgi?id=3450>
          <rdar://problem/3881901> String.replace() method not working when regex pattern contains {n, m}
  
          * layout-tests/fast/js/string_replace-expected.txt: Added.
          * layout-tests/fast/js/string_replace.html: Added.
  
  Revision  Changes    Path
  1.4293    +9 -0      WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.4292
  retrieving revision 1.4293
  diff -u -r1.4292 -r1.4293
  --- ChangeLog	21 Jun 2005 22:27:51 -0000	1.4292
  +++ ChangeLog	21 Jun 2005 23:02:01 -0000	1.4293
  @@ -1,3 +1,12 @@
  +2005-06-21  Adele Peterson  <adele at apple.com>
  +
  +        Test cases for:
  +        <http://bugzilla.opendarwin.org/show_bug.cgi?id=3450>
  +        <rdar://problem/3881901> String.replace() method not working when regex pattern contains {n, m}
  +
  +        * layout-tests/fast/js/string_replace-expected.txt: Added.
  +        * layout-tests/fast/js/string_replace.html: Added.
  +
   2005-06-21  Geoffrey Garen  <ggaren at apple.com>
   
           Patch contributed by Niels Leenheer <niels.leenheer at gmail.com>
  
  
  
  1.1                  WebCore/layout-tests/fast/js/string_replace-expected.txt
  
  Index: string_replace-expected.txt
  ===================================================================
  This will test string.replace with {n, m} regexp patterns.
  Start Value	Replace	End Value
  Change YY to YYYY	dtFormat.replace(/Y{1,4}/g,"YYYY")	YYYY
  Change MM to M	dtFormat.replace(/M{1,2}/g,"M")	M
  Change YY to MMMM	dtFormat.replace(/Y{1,4}/g,"MMMM")	MMMM
  
  
  
  
  1.1                  WebCore/layout-tests/fast/js/string_replace.html
  
  Index: string_replace.html
  ===================================================================
  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  <html>
  <head>
  <title>test replace</title>
  <script language="javascript">
  
  function init()
  {	
  	var dtFormat = "YY";
  	document.getElementById("r0c0").firstChild.nodeValue = "Change " + dtFormat + " to YYYY";
  	document.getElementById("r0c1").firstChild.nodeValue = "dtFormat.replace(/Y{1,4}/g,\"YYYY\")";
  	dtFormat = dtFormat.replace(/Y{1,4}/g,"YYYY");
  	document.getElementById("r0c2").firstChild.nodeValue =  dtFormat;
  
  	dtFormat = "MM";
  	document.getElementById("r1c0").firstChild.nodeValue = "Change " + dtFormat + " to M";
  	document.getElementById("r1c1").firstChild.nodeValue = "dtFormat.replace(/M{1,2}/g,\"M\")";
  	dtFormat = dtFormat.replace(/M{1,2}/g,"M");
  	document.getElementById("r1c2").firstChild.nodeValue =  dtFormat;
  
  	dtFormat = "YY";
  	document.getElementById("r2c0").firstChild.nodeValue = "Change " + dtFormat + " to MMMM";
  	document.getElementById("r2c1").firstChild.nodeValue = "dtFormat.replace(/Y{1,4}/g,\"MMMM\")";
  	dtFormat = dtFormat.replace(/Y{1,4}/g,"MMMM");
  	document.getElementById("r2c2").firstChild.nodeValue =  dtFormat;
          
          if (window.layoutTestController) {
              window.layoutTestController.dumpAsText();
          }
  }
  
  </script>
  </head>
  <body onload="init()">
          This will test string.replace with {n, m} regexp patterns.
  	<table cellpadding="2" cellspacing="2" border="1">
  		<tbody>
  			<tr>
  				<td>Start Value</td>
  				<td>Replace</td>
  				<td>End Value</td>
  			</tr>
  			<tr>
  				<td id="r0c0">&nbsp;</td>
  				<td id="r0c1">&nbsp;</td>
  				<td id="r0c2">&nbsp;</td>
  			</tr>
  			<tr>
  				<td id="r1c0">&nbsp;</td>
  				<td id="r1c1">&nbsp;</td>
  				<td id="r1c2">&nbsp;</td>
  			</tr>
  			<tr>
  				<td id="r2c0">&nbsp;</td>
  				<td id="r2c1">&nbsp;</td>
  				<td id="r2c2">&nbsp;</td>
  			</tr>
  		</tbody>
  	</table>
  
  </body>
  </html>
  
  



More information about the webkit-changes mailing list