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

Unified Diff: tests/language/src/CharEscapeVMTest.dart

Issue 9149005: split out vm-specific tests (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: keeping test closer to original Created 8 years, 11 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/language/src/CharEscapeVMTest.dart
diff --git a/tests/language/src/CharEscapeVMTest.dart b/tests/language/src/CharEscapeVMTest.dart
new file mode 100644
index 0000000000000000000000000000000000000000..fea0083ac2bbd9343012694cda705eec68c85397
--- /dev/null
+++ b/tests/language/src/CharEscapeVMTest.dart
@@ -0,0 +1,36 @@
+// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+// Dart test for reading escape sequences in string literals
+// This test explicitly checks for handling for 4 byte unicode.
+
+class CharEscapeVMTest {
+ static testMain() {
+ var v10000 = "\u{10000}";
+ var v010000 = "\u{010000}";
+ Expect.equals(1, v10000.length);
+ Expect.equals(1, v010000.length);
+ Expect.equals("\u{10000}", new String.fromCharCodes([0x10000]));
+ Expect.equals("\u{010000}", new String.fromCharCodes([0x10000]));
+
+
+ var v1FFFF = "\u{1FFFF}";
+ var v01FFFF = "\u{01FFFF}";
+ Expect.equals(1, v1FFFF.length);
+ Expect.equals(1, v01FFFF.length);
+ Expect.equals("\u{1FFFF}", new String.fromCharCodes([0x1FFFF]));
+ Expect.equals("\u{01FFFF}", new String.fromCharCodes([0x1FFFF]));
+
+ var v105555 = "\u{105555}";
+ Expect.equals(1, v105555.length);
+ Expect.equals("\u{105555}", new String.fromCharCodes([0x105555]));
+
+ var v10FFFF = "\u{10FFFF}";
+ Expect.equals(1, v10FFFF.length);
+ Expect.equals("\u{10FFFF}", new String.fromCharCodes([0x10FFFF]));
+ }
+}
+
+main() {
+ CharEscapeVMTest.testMain();
+}
« tests/language/src/BitOperationsTest.dart ('K') | « tests/language/src/CharEscapeTest.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698