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

Side by Side Diff: test/mime_type_test.dart

Issue 1317773003: pkg/mime: Use pkg/test (Closed) Base URL: https://github.com/dart-lang/mime.git@master
Patch Set: rebase Created 5 years, 3 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 | « test/mime_multipart_transformer_test.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) 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:math' as math; 5 import 'dart:math' as math;
6 6
7 import 'package:unittest/unittest.dart'; 7 import 'package:test/test.dart';
8 import 'package:mime/mime.dart'; 8 import 'package:mime/mime.dart';
9 import 'package:mime/src/magic_number.dart'; 9 import 'package:mime/src/magic_number.dart';
10 10
11 void _expectMimeType(String path, 11 void _expectMimeType(String path,
12 String expectedMimeType, 12 String expectedMimeType,
13 {List<int> headerBytes, 13 {List<int> headerBytes,
14 MimeTypeResolver resolver}) { 14 MimeTypeResolver resolver}) {
15 String mimeType; 15 String mimeType;
16 if (resolver == null) { 16 if (resolver == null) {
17 mimeType = lookupMimeType(path, headerBytes: headerBytes); 17 mimeType = lookupMimeType(path, headerBytes: headerBytes);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 }); 102 });
103 103
104 test('default magic number', () { 104 test('default magic number', () {
105 var actualMaxBytes = DEFAULT_MAGIC_NUMBERS.fold(0, (previous, magic) { 105 var actualMaxBytes = DEFAULT_MAGIC_NUMBERS.fold(0, (previous, magic) {
106 return math.max(previous, magic.numbers.length); 106 return math.max(previous, magic.numbers.length);
107 }); 107 });
108 108
109 expect(defaultMagicNumbersMaxLength, actualMaxBytes); 109 expect(defaultMagicNumbersMaxLength, actualMaxBytes);
110 }); 110 });
111 } 111 }
OLDNEW
« no previous file with comments | « test/mime_multipart_transformer_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698