1.1 --- a/vmtest/src/test/java/org/apidesign/bck2brwsr/tck/CompareStringsTest.java Mon Jan 21 12:53:05 2013 +0100
1.2 +++ b/vmtest/src/test/java/org/apidesign/bck2brwsr/tck/CompareStringsTest.java Wed Jan 30 09:32:05 2013 +0100
1.3 @@ -17,6 +17,7 @@
1.4 */
1.5 package org.apidesign.bck2brwsr.tck;
1.6
1.7 +import java.io.UnsupportedEncodingException;
1.8 import java.net.MalformedURLException;
1.9 import java.net.URL;
1.10 import org.apidesign.bck2brwsr.vmtest.Compare;
1.11 @@ -120,6 +121,21 @@
1.12 NullField nf = new NullField();
1.13 return ("" + nf.name).toString();
1.14 }
1.15 + @Compare
1.16 + public String toUTFString() throws UnsupportedEncodingException {
1.17 + byte[] arr = {
1.18 + (byte) -59, (byte) -67, (byte) 108, (byte) 117, (byte) -59, (byte) -91,
1.19 + (byte) 111, (byte) 117, (byte) -60, (byte) -115, (byte) 107, (byte) -61,
1.20 + (byte) -67, (byte) 32, (byte) 107, (byte) -59, (byte) -81, (byte) -59,
1.21 + (byte) -120
1.22 + };
1.23 + return new String(arr, "utf-8");
1.24 + }
1.25 +
1.26 + @Compare
1.27 + public int stringToBytesLenght() throws UnsupportedEncodingException {
1.28 + return "Žluťoučký kůň".getBytes("utf8").length;
1.29 + }
1.30
1.31 @Factory
1.32 public static Object[] create() {