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

Side by Side Diff: utils/tests/pub/validator/size_test.dart

Issue 14297021: Move pub into sdk/lib/_internal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Disallow package: imports of pub. Created 7 years, 8 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 | Annotate | Revision Log
OLDNEW
(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 }
OLDNEW
« no previous file with comments | « utils/tests/pub/validator/pubspec_field_test.dart ('k') | utils/tests/pub/validator/utf8_readme_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698