| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |