Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: tests/corelib/string_trimlr_test.dart

Issue 2733353002: Remove U+180E from whitespace in js_runtime and tests (Closed)
Patch Set: also corelib_strong Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tests/corelib/string_trimlr_test.dart
diff --git a/tests/corelib/string_trimlr_test.dart b/tests/corelib/string_trimlr_test.dart
index cf47ffc6a8b9fbb3642ba9c852182c27dedb1e5f..2cf4a976da900b2259958d44c6f1cbc58c97e70e 100644
--- a/tests/corelib/string_trimlr_test.dart
+++ b/tests/corelib/string_trimlr_test.dart
@@ -4,13 +4,12 @@
import "package:expect/expect.dart";
-// Characters with Whitespace property (Unicode 6.2).
+// Characters with Whitespace property (Unicode 6.3).
// 0009..000D ; White_Space # Cc <control-0009>..<control-000D>
// 0020 ; White_Space # Zs SPACE
// 0085 ; White_Space # Cc <control-0085>
// 00A0 ; White_Space # Zs NO-BREAK SPACE
// 1680 ; White_Space # Zs OGHAM SPACE MARK
-// 180E ; White_Space # Zs MONGOLIAN VOWEL SEPARATOR
// 2000..200A ; White_Space # Zs EN QUAD..HAIR SPACE
// 2028 ; White_Space # Zl LINE SEPARATOR
// 2029 ; White_Space # Zp PARAGRAPH SEPARATOR
@@ -29,7 +28,6 @@ const WHITESPACE = const [
0x85,
0xA0,
0x1680,
- 0x180E,
0x2000,
0x2001,
0x2002,
@@ -89,15 +87,25 @@ main() {
j++;
continue;
}
- // U+200b is currently being treated as whitespace by some JS engines.
- // Should be fixed in tip-of-tree V8 per 2014-02-10.
- // This line makes string_trimlr_test/none fail but /01 succeede where
- // this bug is in the JS. Both succeede on the VM and where the bug is
- // not. Remove this line and comment if all JS engines fix it.
- if (i == 0x200b) continue; /// 01: ok
+ // See below for these exceptions.
+ if (i == 0x180E) continue;
+ if (i == 0x200B) continue;
var s = new String.fromCharCode(i);
Expect.identical(s, s.trimLeft());
Expect.identical(s, s.trimRight());
}
+
+ // U+200b is currently being treated as whitespace by some JS engines.
+ // string_trimlr_test/01 fails on these engines.
+ // Should be fixed in tip-of-tree V8 per 2014-02-10.
+ var s200B = new String.fromCharCode(0x200B);
+ Expect.identical(s200B, s200B.trimLeft()); /// 01: ok
+ Expect.identical(s200B, s200B.trimRight()); /// 01: ok
+
+ // U+180E ceased to be whitespace in Unicode version 6.3.0
+ // string_trimlr_test/02 fails on implementations using earlier versions.
+ var s180E = new String.fromCharCode(0x180E);
+ Expect.identical(s180E, s180E.trimLeft()); /// 02: ok
+ Expect.identical(s180E, s180E.trimRight()); /// 02: ok
}

Powered by Google App Engine
This is Rietveld 408576698