OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 library validator_test; | 5 library validator_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'dart:io'; | 8 import 'dart:io'; |
9 import 'dart:json' as json; | 9 import 'dart:json' as json; |
10 import 'dart:math' as math; | 10 import 'dart:math' as math; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 integration('has a non-Dart file in lib', () { | 154 integration('has a non-Dart file in lib', () { |
155 dir(appPath, [ | 155 dir(appPath, [ |
156 libPubspec("test_pkg", "1.0.0"), | 156 libPubspec("test_pkg", "1.0.0"), |
157 dir("lib", [ | 157 dir("lib", [ |
158 file("thing.txt", "woo hoo") | 158 file("thing.txt", "woo hoo") |
159 ]) | 159 ]) |
160 ]).scheduleCreate(); | 160 ]).scheduleCreate(); |
161 expectNoValidationError(lib); | 161 expectNoValidationError(lib); |
162 }); | 162 }); |
163 | 163 |
164 integration('has an unconstrained dependency on "unittest"', () { | |
165 dir(appPath, [ | |
166 libPubspec("test_pkg", "1.0.0", deps: [ | |
167 {'hosted': 'unittest'} | |
168 ]) | |
169 ]).scheduleCreate(); | |
170 expectNoValidationError(dependency); | |
171 }); | |
172 | |
173 integration('has a nested directory named "tools"', () { | 164 integration('has a nested directory named "tools"', () { |
174 dir(appPath, [ | 165 dir(appPath, [ |
175 dir("foo", [dir("tools")]) | 166 dir("foo", [dir("tools")]) |
176 ]).scheduleCreate(); | 167 ]).scheduleCreate(); |
177 expectNoValidationError(directory); | 168 expectNoValidationError(directory); |
178 }); | 169 }); |
179 | 170 |
180 integration('is <= 10 MB', () { | 171 integration('is <= 10 MB', () { |
181 expectNoValidationError(size(100)); | 172 expectNoValidationError(size(100)); |
182 expectNoValidationError(size(10 * math.pow(2, 20))); | 173 expectNoValidationError(size(10 * math.pow(2, 20))); |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 }); | 567 }); |
577 | 568 |
578 test('has a README with invalid utf-8', () { | 569 test('has a README with invalid utf-8', () { |
579 dir(appPath, [ | 570 dir(appPath, [ |
580 binaryFile("README", [192]) | 571 binaryFile("README", [192]) |
581 ]).scheduleCreate(); | 572 ]).scheduleCreate(); |
582 expectValidationWarning(utf8Readme); | 573 expectValidationWarning(utf8Readme); |
583 }); | 574 }); |
584 }); | 575 }); |
585 } | 576 } |
OLD | NEW |