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

Unified Diff: test/shelf_io_test.dart

Issue 837193005: pkg/shelf: formatted code (Closed) Base URL: https://github.com/dart-lang/shelf.git@master
Patch Set: nits Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/response_test.dart ('k') | test/test_util.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/shelf_io_test.dart
diff --git a/test/shelf_io_test.dart b/test/shelf_io_test.dart
index c1b4a410cd5fa9c5a0688de38d2a7f2b7dd8b5f1..1a0ad785281864cce965efbf0704a7edac4cfe99 100644
--- a/test/shelf_io_test.dart
+++ b/test/shelf_io_test.dart
@@ -94,8 +94,8 @@ void main() {
return syncHandler(request);
});
- return schedule(() => http.get('http://localhost:$_serverPort$path'))
- .then((response) {
+ return schedule(() => http.get('http://localhost:$_serverPort$path')).then(
+ (response) {
expect(response.statusCode, HttpStatus.OK);
expect(response.body, 'Hello from /foo/bar');
});
@@ -103,10 +103,8 @@ void main() {
test('custom response headers are received by the client', () {
_scheduleServer((request) {
- return new Response.ok('Hello from /', headers: {
- 'test-header': 'test-value',
- 'test-list': 'a, b, c'
- });
+ return new Response.ok('Hello from /',
+ headers: {'test-header': 'test-value', 'test-list': 'a, b, c'});
});
return _scheduleGet().then((response) {
@@ -193,8 +191,7 @@ void main() {
request.hijack(expectAsync((stream, sink) {
expect(stream.first, completion(equals("Hello".codeUnits)));
- sink.add((
- "HTTP/1.1 404 Not Found\r\n"
+ sink.add(("HTTP/1.1 404 Not Found\r\n"
"Date: Mon, 23 May 2005 22:38:34 GMT\r\n"
"Content-Length: 13\r\n"
"\r\n"
@@ -206,8 +203,8 @@ void main() {
return _schedulePost(body: "Hello").then((response) {
expect(response.statusCode, HttpStatus.NOT_FOUND);
expect(response.headers["date"], "Mon, 23 May 2005 22:38:34 GMT");
- expect(response.stream.bytesToString(),
- completion(equals("Hello, world!")));
+ expect(
+ response.stream.bytesToString(), completion(equals("Hello, world!")));
});
});
@@ -301,9 +298,8 @@ void main() {
test('defers to header in response', () {
var date = new DateTime.utc(1981, 6, 5);
_scheduleServer((request) {
- return new Response.ok('test', headers: {
- HttpHeaders.DATE: parser.formatHttpDate(date)
- });
+ return new Response.ok('test',
+ headers: {HttpHeaders.DATE: parser.formatHttpDate(date)});
});
return _scheduleGet().then((response) {
@@ -353,17 +349,15 @@ Future _scheduleServer(Handler handler) {
Future<http.Response> _scheduleGet({Map<String, String> headers}) {
if (headers == null) headers = {};
- return schedule(() =>
- http.get('http://localhost:$_serverPort/', headers: headers));
+ return schedule(
+ () => http.get('http://localhost:$_serverPort/', headers: headers));
}
-Future<http.StreamedResponse> _schedulePost({Map<String, String> headers,
- String body}) {
-
+Future<http.StreamedResponse> _schedulePost(
+ {Map<String, String> headers, String body}) {
return schedule(() {
-
- var request = new http.Request('POST',
- Uri.parse('http://localhost:$_serverPort/'));
+ var request =
+ new http.Request('POST', Uri.parse('http://localhost:$_serverPort/'));
if (headers != null) request.headers.addAll(headers);
if (body != null) request.body = body;
« no previous file with comments | « test/response_test.dart ('k') | test/test_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698