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

Side by Side Diff: tests/standalone/io/file_non_ascii_sync_test.dart

Issue 12743005: Revert "Remove Expect from core library." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Reupload (first upload failed). Created 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import "package:expect/expect.dart";
6 import 'dart:io'; 5 import 'dart:io';
7 6
8 main() { 7 main() {
9 Directory tempDir = new Directory('').createTempSync(); 8 Directory tempDir = new Directory('').createTempSync();
10 Directory nonAsciiDir = new Directory('${tempDir.path}/æøå'); 9 Directory nonAsciiDir = new Directory('${tempDir.path}/æøå');
11 nonAsciiDir.createSync(); 10 nonAsciiDir.createSync();
12 Expect.isTrue(nonAsciiDir.existsSync()); 11 Expect.isTrue(nonAsciiDir.existsSync());
13 File nonAsciiFile = new File('${nonAsciiDir.path}/æøå.txt'); 12 File nonAsciiFile = new File('${nonAsciiDir.path}/æøå.txt');
14 nonAsciiFile.writeAsStringSync('æøå'); 13 nonAsciiFile.writeAsStringSync('æøå');
15 Expect.isTrue(nonAsciiFile.existsSync()); 14 Expect.isTrue(nonAsciiFile.existsSync());
16 // On MacOS you get the decomposed utf8 form of file and directory 15 // On MacOS you get the decomposed utf8 form of file and directory
17 // names from the system. Therefore, we have to check for both here. 16 // names from the system. Therefore, we have to check for both here.
18 var precomposed = 'æøå'; 17 var precomposed = 'æøå';
19 var decomposed = new String.fromCharCodes([47, 230, 248, 97, 778]); 18 var decomposed = new String.fromCharCodes([47, 230, 248, 97, 778]);
20 // The contents of the file is precomposed utf8. 19 // The contents of the file is precomposed utf8.
21 Expect.equals(precomposed, nonAsciiFile.readAsStringSync()); 20 Expect.equals(precomposed, nonAsciiFile.readAsStringSync());
22 nonAsciiFile.createSync(); 21 nonAsciiFile.createSync();
23 var path = nonAsciiFile.directorySync().path; 22 var path = nonAsciiFile.directorySync().path;
24 Expect.isTrue(path.endsWith(precomposed) || path.endsWith(decomposed)); 23 Expect.isTrue(path.endsWith(precomposed) || path.endsWith(decomposed));
25 Expect.equals(6, nonAsciiFile.lengthSync()); 24 Expect.equals(6, nonAsciiFile.lengthSync());
26 nonAsciiFile.lastModifiedSync(); 25 nonAsciiFile.lastModifiedSync();
27 path = nonAsciiFile.fullPathSync(); 26 path = nonAsciiFile.fullPathSync();
28 Expect.isTrue(path.endsWith('${precomposed}.txt') || 27 Expect.isTrue(path.endsWith('${precomposed}.txt') ||
29 path.endsWith('${decomposed}.txt')); 28 path.endsWith('${decomposed}.txt'));
30 tempDir.deleteSync(recursive: true); 29 tempDir.deleteSync(recursive: true);
31 } 30 }
OLDNEW
« no previous file with comments | « tests/standalone/io/file_invalid_arguments_test.dart ('k') | tests/standalone/io/file_non_ascii_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698