| 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 // Test script for testing that output is handled correctly for | 5 // Test script for testing that output is handled correctly for |
| 6 // non-interactive processes started with Process.run. | 6 // non-interactive processes started with Process.run. |
| 7 | 7 |
| 8 import "package:expect/expect.dart"; |
| 8 import "dart:io"; | 9 import "dart:io"; |
| 9 import "process_test_util.dart"; | 10 import "process_test_util.dart"; |
| 10 | 11 |
| 11 checkOutput(encoding, output) { | 12 checkOutput(encoding, output) { |
| 12 if (encoding == 'ascii') { | 13 if (encoding == 'ascii') { |
| 13 Expect.equals(output, 'abc'); | 14 Expect.equals(output, 'abc'); |
| 14 } else if (encoding == 'latin1') { | 15 } else if (encoding == 'latin1') { |
| 15 Expect.equals(output, 'æøå'); | 16 Expect.equals(output, 'æøå'); |
| 16 } else if (encoding == 'utf8') { | 17 } else if (encoding == 'utf8') { |
| 17 Expect.listEquals(output.codeUnits, [955]); | 18 Expect.listEquals(output.codeUnits, [955]); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 59 } |
| 59 Expect.isTrue(scriptFile.existsSync()); | 60 Expect.isTrue(scriptFile.existsSync()); |
| 60 test(scriptFile.path, 'ascii', 'stdout'); | 61 test(scriptFile.path, 'ascii', 'stdout'); |
| 61 test(scriptFile.path, 'ascii', 'stderr'); | 62 test(scriptFile.path, 'ascii', 'stderr'); |
| 62 test(scriptFile.path, 'latin1', 'stdout'); | 63 test(scriptFile.path, 'latin1', 'stdout'); |
| 63 test(scriptFile.path, 'latin1', 'stderr'); | 64 test(scriptFile.path, 'latin1', 'stderr'); |
| 64 test(scriptFile.path, 'utf8', 'stdout'); | 65 test(scriptFile.path, 'utf8', 'stdout'); |
| 65 test(scriptFile.path, 'utf8', 'stderr'); | 66 test(scriptFile.path, 'utf8', 'stderr'); |
| 66 | 67 |
| 67 } | 68 } |
| OLD | NEW |