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

Unified Diff: tests/standalone/io/file_non_ascii_test.dart

Issue 11275281: Update dart:io to convert strings between UTF8 and current code page (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments Created 8 years, 1 month 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
« no previous file with comments | « tests/standalone/io/file_non_ascii_sync_test.dart ('k') | tests/standalone/io/process_non_ascii_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/io/file_non_ascii_test.dart
diff --git a/tests/standalone/io/file_non_ascii_test.dart b/tests/standalone/io/file_non_ascii_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..e1a4d2a19862e0122ad475e8b4066d3c66bdc155
--- /dev/null
+++ b/tests/standalone/io/file_non_ascii_test.dart
@@ -0,0 +1,32 @@
+// Copyright (c) 2012, 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.
+
+import 'dart:io';
+import 'dart:isolate';
+
+main() {
+ var port = new ReceivePort();
+ Directory scriptDir = new File(new Options().script).directorySync();
+ var f = new File("${scriptDir.path}/æøå/æøå.dat");
+ f.exists().then((e) {
+ Expect.isTrue(e);
+ f.create().then((_) {
+ f.directory().then((d) {
+ Expect.isTrue(d.path.endsWith('æøå'));
+ f.length().then((l) {
+ Expect.equals(6, l);
+ f.lastModified().then((_) {
+ f.fullPath().then((p) {
+ Expect.isTrue(p.endsWith('æøå.dat'));
+ f.readAsText().then((contents) {
+ Expect.equals('æøå', contents);
+ port.close();
+ });
+ });
+ });
+ });
+ });
+ });
+ });
+}
« no previous file with comments | « tests/standalone/io/file_non_ascii_sync_test.dart ('k') | tests/standalone/io/process_non_ascii_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698