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

Side by Side Diff: utils/tests/pub/validator_test.dart

Issue 12301032: Use the correct set of reserved identifiers in pub validations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
« no previous file with comments | « utils/pub/validator/name.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « utils/pub/validator/name.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698