| OLD | NEW |
| 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 "package:expect/expect.dart"; |
| 6 import 'dart:io'; | 6 import 'dart:io'; |
| 7 | 7 |
| 8 main() { | 8 main() { |
| 9 Directory temp = new Directory('').createTempSync(); | 9 Directory temp = Directory.systemTemp.createTempSync('dart_regress_7679'); |
| 10 File script = new File('${temp.path}/script.dart'); | 10 File script = new File('${temp.path}/script.dart'); |
| 11 script.writeAsStringSync(""" | 11 script.writeAsStringSync(""" |
| 12 import 'dart:io'; | 12 import 'dart:io'; |
| 13 | 13 |
| 14 class Expect { | 14 class Expect { |
| 15 static void isTrue(var x) { | 15 static void isTrue(var x) { |
| 16 if (!identical(x, true)) { | 16 if (!identical(x, true)) { |
| 17 throw new Error("Not identical"); | 17 throw new Error("Not identical"); |
| 18 } | 18 } |
| 19 } | 19 } |
| (...skipping 14 matching lines...) Expand all Loading... |
| 34 }); | 34 }); |
| 35 } | 35 } |
| 36 """); | 36 """); |
| 37 String executable = new File(Platform.executable).fullPathSync(); | 37 String executable = new File(Platform.executable).fullPathSync(); |
| 38 Process.run(executable, ['script.dart'], workingDirectory: temp.path) | 38 Process.run(executable, ['script.dart'], workingDirectory: temp.path) |
| 39 .then((result) { | 39 .then((result) { |
| 40 temp.deleteSync(recursive: true); | 40 temp.deleteSync(recursive: true); |
| 41 Expect.equals(0, result.exitCode); | 41 Expect.equals(0, result.exitCode); |
| 42 }); | 42 }); |
| 43 } | 43 } |
| OLD | NEW |