incubator-flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael A. Labriola" <labri...@digitalprimates.net>
Subject RE: Spark StringValidator
Date Thu, 19 Jan 2012 16:56:52 GMT
Omar-

I will look too. It should occur anywhere that a character is represented by a surrogate pair.

-----Original Message-----
From: Omar Gonzalez [mailto:omarg.developer@gmail.com]
Sent: Tuesday, January 17, 2012 7:22 PM
To: flex-dev@incubator.apache.org
Subject: Re: Spark StringValidator

Do you have any unit tests set up that replicate the issue?

I set up some really basic tests to see if I could get a failed test but perhaps I'm not understanding
the bug correctly, below are the tests I ran (just a few quickies) but none of them failed.

package flexUnitTests

{

import org.flexunit.asserts.assertEquals;

import org.flexunit.asserts.fail;


 public class StringTests

{


 [Test]

 public function length_arabicString_lengthShouldReturnEight():void

 {

 var arabic:String = "الأربعاء";


  assertEquals(8, arabic.length);

 }


 [Test]

 public function length_chineseString_lengthShouldReturnTwentyNine():void

 {

 var chinese:String = "Here is some arabic: الأربعاء";


  assertEquals(29, chinese.length);

 }


 [Test]

 public function length_japaneseString_lengthShouldReturnTen():void

 {

 var japanese:String = "一二三四五六七八九〇";


  assertEquals(10, japanese.length);

 }


 [Test]

 public function length_spanishString_lengthShouldReturnSeventeen():void

 {

 var spanish:String = "la niña usa una ñ";


  assertEquals(17, spanish.length);

 }


 [Test]

 public function length_chineseString_lengthShouldReturnThree():void

 {

 var chinese:String = "假借字";


  assertEquals(3, chinese.length);

 }


 [Test]

 public function length_chineseString_lengthShouldReturnNine():void

 {

 var chinese:String = "假借字形声字形聲字";


  assertEquals(9, chinese.length);

 }


 [Test]

 public function length_chineseString_lengthShouldReturnThirteen():void

 {

 var chinese:String = "假借字 形声字 / 形聲字";


  assertEquals(13, chinese.length);

 }


 [Test]

 public function length_chineseString_lengthShouldReturnThirtyFive():void

 {

 var chinese:String = "Here is some chinese: 假借字 形声字 / 形聲字";


  assertEquals(35, chinese.length);

 }

}

}



-omar
Notice: This transmission is intended only for the use of the individual or entity to which
it is addressed and may contain information that is privileged or confidential. Any dissemination,
distribution or copying of this transmission by anyone other than the intended recipient is
strictly prohibited. If you have received this transmission in error, please notify the sender
immediately by e-mail or telephone and delete the original transmission. Thank you.
Mime
View raw message