OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 import 'dart:async'; | |
6 import 'dart:math' as math; | |
7 | |
8 import 'package:scheduled_test/scheduled_test.dart'; | |
9 | |
10 import '../../../pub/entrypoint.dart'; | |
11 import '../../../pub/validator.dart'; | |
12 import '../../../pub/validator/size.dart'; | |
13 import '../descriptor.dart' as d; | |
14 import '../test_pub.dart'; | |
15 import 'utils.dart'; | |
16 | |
17 Function size(int size) { | |
18 return (entrypoint) => | |
19 new SizeValidator(entrypoint, new Future.value(size)); | |
20 } | |
21 | |
22 main() { | |
23 initConfig(); | |
24 | |
25 setUp(d.validPackage.create); | |
26 | |
27 integration('should consider a package valid if it is <= 10 MB', () { | |
28 expectNoValidationError(size(100)); | |
29 expectNoValidationError(size(10 * math.pow(2, 20))); | |
30 }); | |
31 | |
32 integration('should consider a package invalid if it is more than 10 MB', () { | |
33 expectValidationError(size(10 * math.pow(2, 20) + 1)); | |
34 }); | |
35 } | |
OLD | NEW |