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

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

Issue 12212016: Remove Expect from core library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add deprecation comment for ExpectException and revert one test. Created 7 years, 8 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 import 'dart:isolate'; 7 import 'dart:isolate';
7 8
8 main() { 9 main() {
9 var port = new ReceivePort(); 10 var port = new ReceivePort();
10 var executable = new File(new Options().executable).fullPathSync(); 11 var executable = new File(new Options().executable).fullPathSync();
11 var tempDir = new Directory('').createTempSync(); 12 var tempDir = new Directory('').createTempSync();
12 var nonAsciiDir = new Directory('${tempDir.path}/æøå'); 13 var nonAsciiDir = new Directory('${tempDir.path}/æøå');
13 nonAsciiDir.createSync(); 14 nonAsciiDir.createSync();
14 var nonAsciiFile = new File('${nonAsciiDir.path}/æøå.dart'); 15 var nonAsciiFile = new File('${nonAsciiDir.path}/æøå.dart');
15 nonAsciiFile.writeAsStringSync( 16 nonAsciiFile.writeAsStringSync(
16 """ 17 """
17 import 'dart:io'; 18 import 'dart:io';
18 19
19 main() { 20 main() {
20 Expect.equals('æøå', new File('æøå.txt').readAsStringSync()); 21 if ('æøå' != new File('æøå.txt').readAsStringSync()) {
22 throw new RuntimeError("not equal");
23 }
21 } 24 }
22 """); 25 """);
23 var nonAsciiTxtFile = new File('${nonAsciiDir.path}/æøå.txt'); 26 var nonAsciiTxtFile = new File('${nonAsciiDir.path}/æøå.txt');
24 nonAsciiTxtFile.writeAsStringSync('æøå'); 27 nonAsciiTxtFile.writeAsStringSync('æøå');
25 var options = new ProcessOptions(); 28 var options = new ProcessOptions();
26 options.workingDirectory = nonAsciiDir.path; 29 options.workingDirectory = nonAsciiDir.path;
27 var script = nonAsciiFile.path; 30 var script = nonAsciiFile.path;
28 Process.run(executable, [script], options).then((result) { 31 Process.run(executable, [script], options).then((result) {
29 Expect.equals(0, result.exitCode); 32 Expect.equals(0, result.exitCode);
30 tempDir.deleteSync(recursive: true); 33 tempDir.deleteSync(recursive: true);
31 port.close(); 34 port.close();
32 }); 35 });
33 } 36 }
OLDNEW
« no previous file with comments | « tests/standalone/io/process_kill_test.dart ('k') | tests/standalone/io/process_path_environment_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698