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

Side by Side Diff: tests/compiler/dart2js/zero_termination_test.dart

Issue 1934883002: Refactor unittests (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 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
« no previous file with comments | « tests/compiler/dart2js/sourcemaps/operators_test_file.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/sourcemaps/operators_test_file.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698