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 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 dir(appPath, [libPubspec("8ball", "1.0.0")]).scheduleCreate(); | 291 dir(appPath, [libPubspec("8ball", "1.0.0")]).scheduleCreate(); |
292 expectValidationError(name); | 292 expectValidationError(name); |
293 }); | 293 }); |
294 | 294 |
295 integration('has a package name that contains upper-case letters', () { | 295 integration('has a package name that contains upper-case letters', () { |
296 dir(appPath, [libPubspec("TestPkg", "1.0.0")]).scheduleCreate(); | 296 dir(appPath, [libPubspec("TestPkg", "1.0.0")]).scheduleCreate(); |
297 expectValidationWarning(name); | 297 expectValidationWarning(name); |
298 }); | 298 }); |
299 | 299 |
300 integration('has a package name that is a Dart reserved word', () { | 300 integration('has a package name that is a Dart reserved word', () { |
301 dir(appPath, [libPubspec("operator", "1.0.0")]).scheduleCreate(); | 301 dir(appPath, [libPubspec("final", "1.0.0")]).scheduleCreate(); |
302 expectValidationError(name); | 302 expectValidationError(name); |
303 }); | 303 }); |
304 | 304 |
305 integration('has a library name with an invalid character', () { | 305 integration('has a library name with an invalid character', () { |
306 dir(appPath, [ | 306 dir(appPath, [ |
307 libPubspec("test_pkg", "1.0.0"), | 307 libPubspec("test_pkg", "1.0.0"), |
308 dir("lib", [file("test-pkg.dart", "int i = 0;")]) | 308 dir("lib", [file("test-pkg.dart", "int i = 0;")]) |
309 ]).scheduleCreate(); | 309 ]).scheduleCreate(); |
310 expectValidationError(name); | 310 expectValidationError(name); |
311 }); | 311 }); |
(...skipping 10 matching lines...) Expand all Loading... |
322 dir(appPath, [ | 322 dir(appPath, [ |
323 libPubspec("test_pkg", "1.0.0"), | 323 libPubspec("test_pkg", "1.0.0"), |
324 dir("lib", [file("TestPkg.dart", "int i = 0;")]) | 324 dir("lib", [file("TestPkg.dart", "int i = 0;")]) |
325 ]).scheduleCreate(); | 325 ]).scheduleCreate(); |
326 expectValidationWarning(name); | 326 expectValidationWarning(name); |
327 }); | 327 }); |
328 | 328 |
329 integration('has a library name that is a Dart reserved word', () { | 329 integration('has a library name that is a Dart reserved word', () { |
330 dir(appPath, [ | 330 dir(appPath, [ |
331 libPubspec("test_pkg", "1.0.0"), | 331 libPubspec("test_pkg", "1.0.0"), |
332 dir("lib", [file("operator.dart", "int i = 0;")]) | 332 dir("lib", [file("for.dart", "int i = 0;")]) |
333 ]).scheduleCreate(); | 333 ]).scheduleCreate(); |
334 expectValidationError(name); | 334 expectValidationError(name); |
335 }); | 335 }); |
336 | 336 |
337 integration('has a single library named differently than the package', () { | 337 integration('has a single library named differently than the package', () { |
338 file(path.join(appPath, "lib", "test_pkg.dart"), '').scheduleDelete(); | 338 file(path.join(appPath, "lib", "test_pkg.dart"), '').scheduleDelete(); |
339 dir(appPath, [ | 339 dir(appPath, [ |
340 dir("lib", [file("best_pkg.dart", "int i = 0;")]) | 340 dir("lib", [file("best_pkg.dart", "int i = 0;")]) |
341 ]).scheduleCreate(); | 341 ]).scheduleCreate(); |
342 expectValidationWarning(name); | 342 expectValidationWarning(name); |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 }); | 576 }); |
577 | 577 |
578 test('has a README with invalid utf-8', () { | 578 test('has a README with invalid utf-8', () { |
579 dir(appPath, [ | 579 dir(appPath, [ |
580 binaryFile("README", [192]) | 580 binaryFile("README", [192]) |
581 ]).scheduleCreate(); | 581 ]).scheduleCreate(); |
582 expectValidationWarning(utf8Readme); | 582 expectValidationWarning(utf8Readme); |
583 }); | 583 }); |
584 }); | 584 }); |
585 } | 585 } |
OLD | NEW |