OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // A regression test for issue 22667. | 5 // A regression test for issue 22667. |
6 // | 6 // |
7 // Makes sure that we don't print a '\0' character for files that are not | 7 // Makes sure that we don't print a '\0' character for files that are not |
8 // properly new-line terminated. | 8 // properly new-line terminated. |
9 library zero_termination_test; | 9 library zero_termination_test; |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 String stdoutString = UTF8.decode(stdout); | 60 String stdoutString = UTF8.decode(stdout); |
61 Expect.isTrue(stdoutString.contains("Error")); | 61 Expect.isTrue(stdoutString.contains("Error")); |
62 // Make sure the "499" from the last line is in the output. | 62 // Make sure the "499" from the last line is in the output. |
63 Expect.isTrue(stdoutString.contains("499")); | 63 Expect.isTrue(stdoutString.contains("499")); |
64 | 64 |
65 // Make sure that the output does not contain any 0 character. | 65 // Make sure that the output does not contain any 0 character. |
66 Expect.isFalse(stdout.contains(0)); | 66 Expect.isFalse(stdout.contains(0)); |
67 } | 67 } |
68 | 68 |
69 Future testFile() async { | 69 Future testFile() async { |
70 String inFilePath = pathOfData.resolve('one_line_dart_program.dart').path; | 70 String inFilePath = |
| 71 pathOfData.resolve('data/one_line_dart_program.dart').path; |
71 List<String> args = [inFilePath, "--out=" + outFilePath]; | 72 List<String> args = [inFilePath, "--out=" + outFilePath]; |
72 | 73 |
73 await cleanup(); | 74 await cleanup(); |
74 check(await launchDart2Js(args)); | 75 check(await launchDart2Js(args)); |
75 await cleanup(); | 76 await cleanup(); |
76 } | 77 } |
77 | 78 |
78 Future serverRunning(HttpServer server) async { | 79 Future serverRunning(HttpServer server) async { |
79 int port = server.port; | 80 int port = server.port; |
80 String inFilePath = "http://127.0.0.1:$port/one_line_dart_program.dart"; | 81 String inFilePath = "http://127.0.0.1:$port/data/one_line_dart_program.dart"; |
81 List<String> args = [inFilePath, "--out=" + outFilePath]; | 82 List<String> args = [inFilePath, "--out=" + outFilePath]; |
82 | 83 |
83 server.listen(handleRequest); | 84 server.listen(handleRequest); |
84 try { | 85 try { |
85 await cleanup(); | 86 await cleanup(); |
86 check(await launchDart2Js(args)); | 87 check(await launchDart2Js(args)); |
87 } finally { | 88 } finally { |
88 await server.close(); | 89 await server.close(); |
89 await cleanup(); | 90 await cleanup(); |
90 } | 91 } |
(...skipping 13 matching lines...) Expand all Loading... |
104 await testHttp(); | 105 await testHttp(); |
105 } finally { | 106 } finally { |
106 await tempDir.delete(recursive:true); | 107 await tempDir.delete(recursive:true); |
107 } | 108 } |
108 } | 109 } |
109 | 110 |
110 main() { | 111 main() { |
111 asyncStart(); | 112 asyncStart(); |
112 runTests().whenComplete(asyncEnd); | 113 runTests().whenComplete(asyncEnd); |
113 } | 114 } |
OLD | NEW |