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

Side by Side Diff: test/multipart_test.dart

Issue 2133143002: Fix an error in multipart_test (Closed) Base URL: git@github.com:dart-lang/http.git@master
Patch Set: Version .4-dev Created 4 years, 5 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 | « pubspec.yaml ('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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:http/http.dart' as http; 7 import 'package:http/http.dart' as http;
8 import 'package:http_parser/http_parser.dart'; 8 import 'package:http_parser/http_parser.dart';
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 }); 89 });
90 90
91 test('with a unicode field value', () { 91 test('with a unicode field value', () {
92 var request = new http.MultipartRequest('POST', dummyUrl); 92 var request = new http.MultipartRequest('POST', dummyUrl);
93 request.fields['field'] = 'vⱥlūe'; 93 request.fields['field'] = 'vⱥlūe';
94 94
95 expect(request, bodyMatches(''' 95 expect(request, bodyMatches('''
96 --{{boundary}} 96 --{{boundary}}
97 content-disposition: form-data; name="field" 97 content-disposition: form-data; name="field"
98 content-type: text/plain; charset=utf-8 98 content-type: text/plain; charset=utf-8
99 content-transfer-encoding: binary
100
99 101
100 vⱥlūe 102 vⱥlūe
101 --{{boundary}}-- 103 --{{boundary}}--
102 ''')); 104 '''));
103 }); 105 });
104 106
105 test('with a unicode filename', () { 107 test('with a unicode filename', () {
106 var request = new http.MultipartRequest('POST', dummyUrl); 108 var request = new http.MultipartRequest('POST', dummyUrl);
107 request.files.add(new http.MultipartFile.fromString('file', 'contents', 109 request.files.add(new http.MultipartFile.fromString('file', 'contents',
108 filename: 'fïlēname.txt')); 110 filename: 'fïlēname.txt'));
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 expect(request, bodyMatches(''' 226 expect(request, bodyMatches('''
225 --{{boundary}} 227 --{{boundary}}
226 content-type: application/octet-stream 228 content-type: application/octet-stream
227 content-disposition: form-data; name="file" 229 content-disposition: form-data; name="file"
228 230
229 hello 231 hello
230 --{{boundary}}-- 232 --{{boundary}}--
231 ''')); 233 '''));
232 }); 234 });
233 } 235 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698