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

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

Issue 11364232: Fix file test to test for both decomposed and precomposed utf16 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
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
index e1a4d2a19862e0122ad475e8b4066d3c66bdc155..437528ffdc34b789d35f9b5b157727bc5f1c1bd8 100644
--- a/tests/standalone/io/file_non_ascii_test.dart
+++ b/tests/standalone/io/file_non_ascii_test.dart
@@ -9,18 +9,24 @@ main() {
var port = new ReceivePort();
Directory scriptDir = new File(new Options().script).directorySync();
var f = new File("${scriptDir.path}/æøå/æøå.dat");
+ // On MacOS you get the decomposed utf8 form of file and directory
+ // names from the system. Therefore, we have to check for both here.
+ var precomposed = 'æøå';
+ var decomposed = new String.fromCharCodes([47, 230, 248, 97, 778]);
f.exists().then((e) {
Expect.isTrue(e);
f.create().then((_) {
f.directory().then((d) {
- Expect.isTrue(d.path.endsWith('æøå'));
+ Expect.isTrue(d.path.endsWith(precomposed) ||
+ d.path.endsWith(decomposed));
f.length().then((l) {
Expect.equals(6, l);
f.lastModified().then((_) {
f.fullPath().then((p) {
- Expect.isTrue(p.endsWith('æøå.dat'));
+ Expect.isTrue(p.endsWith('${precomposed}.dat') ||
+ p.endsWith('${decomposed}.dat'));
f.readAsText().then((contents) {
- Expect.equals('æøå', contents);
+ Expect.equals(precomposed, contents);
port.close();
});
});

Powered by Google App Engine
This is Rietveld 408576698