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

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

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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";
5 import 'dart:io'; 6 import 'dart:io';
6 7
7 main() { 8 main() {
8 Directory tempDir = new Directory('').createTempSync(); 9 Directory tempDir = new Directory('').createTempSync();
9 Directory nonAsciiDir = new Directory('${tempDir.path}/æøå'); 10 Directory nonAsciiDir = new Directory('${tempDir.path}/æøå');
10 nonAsciiDir.createSync(); 11 nonAsciiDir.createSync();
11 Expect.isTrue(nonAsciiDir.existsSync()); 12 Expect.isTrue(nonAsciiDir.existsSync());
12 File nonAsciiFile = new File('${nonAsciiDir.path}/æøå.txt'); 13 File nonAsciiFile = new File('${nonAsciiDir.path}/æøå.txt');
13 nonAsciiFile.writeAsStringSync('æøå'); 14 nonAsciiFile.writeAsStringSync('æøå');
14 Expect.isTrue(nonAsciiFile.existsSync()); 15 Expect.isTrue(nonAsciiFile.existsSync());
15 // On MacOS you get the decomposed utf8 form of file and directory 16 // On MacOS you get the decomposed utf8 form of file and directory
16 // names from the system. Therefore, we have to check for both here. 17 // names from the system. Therefore, we have to check for both here.
17 var precomposed = 'æøå'; 18 var precomposed = 'æøå';
18 var decomposed = new String.fromCharCodes([47, 230, 248, 97, 778]); 19 var decomposed = new String.fromCharCodes([47, 230, 248, 97, 778]);
19 // The contents of the file is precomposed utf8. 20 // The contents of the file is precomposed utf8.
20 Expect.equals(precomposed, nonAsciiFile.readAsStringSync()); 21 Expect.equals(precomposed, nonAsciiFile.readAsStringSync());
21 nonAsciiFile.createSync(); 22 nonAsciiFile.createSync();
22 var path = nonAsciiFile.directorySync().path; 23 var path = nonAsciiFile.directorySync().path;
23 Expect.isTrue(path.endsWith(precomposed) || path.endsWith(decomposed)); 24 Expect.isTrue(path.endsWith(precomposed) || path.endsWith(decomposed));
24 Expect.equals(6, nonAsciiFile.lengthSync()); 25 Expect.equals(6, nonAsciiFile.lengthSync());
25 nonAsciiFile.lastModifiedSync(); 26 nonAsciiFile.lastModifiedSync();
26 path = nonAsciiFile.fullPathSync(); 27 path = nonAsciiFile.fullPathSync();
27 Expect.isTrue(path.endsWith('${precomposed}.txt') || 28 Expect.isTrue(path.endsWith('${precomposed}.txt') ||
28 path.endsWith('${decomposed}.txt')); 29 path.endsWith('${decomposed}.txt'));
29 tempDir.deleteSync(recursive: true); 30 tempDir.deleteSync(recursive: true);
30 } 31 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698