OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 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 | 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 import 'package:path/path.dart' as path; | 5 import 'package:path/path.dart' as path; |
6 import 'package:scheduled_test/scheduled_test.dart'; | 6 import 'package:scheduled_test/scheduled_test.dart'; |
7 | 7 |
8 import '../../lib/src/entrypoint.dart'; | 8 import '../../lib/src/entrypoint.dart'; |
9 import '../../lib/src/io.dart'; | 9 import '../../lib/src/io.dart'; |
10 import '../../lib/src/validator.dart'; | 10 import '../../lib/src/validator.dart'; |
(...skipping 15 matching lines...) Expand all Loading... |
26 integration('has a badly-named library in lib/src', () { | 26 integration('has a badly-named library in lib/src', () { |
27 d.dir(appPath, [ | 27 d.dir(appPath, [ |
28 d.libPubspec("test_pkg", "1.0.0"), | 28 d.libPubspec("test_pkg", "1.0.0"), |
29 d.dir("lib", [ | 29 d.dir("lib", [ |
30 d.file("test_pkg.dart", "int i = 1;"), | 30 d.file("test_pkg.dart", "int i = 1;"), |
31 d.dir("src", [d.file("8ball.dart", "int j = 2;")]) | 31 d.dir("src", [d.file("8ball.dart", "int j = 2;")]) |
32 ]) | 32 ]) |
33 ]).create(); | 33 ]).create(); |
34 expectNoValidationError(name); | 34 expectNoValidationError(name); |
35 }); | 35 }); |
| 36 |
| 37 integration('has a name that starts with an underscore', () { |
| 38 d.dir(appPath, [ |
| 39 d.libPubspec("_test_pkg", "1.0.0"), |
| 40 d.dir("lib", [ |
| 41 d.file("_test_pkg.dart", "int i = 1;") |
| 42 ]) |
| 43 ]).create(); |
| 44 expectNoValidationError(name); |
| 45 }); |
36 }); | 46 }); |
37 | 47 |
38 group('should consider a package invalid if it', () { | 48 group('should consider a package invalid if it', () { |
39 setUp(d.validPackage.create); | 49 setUp(d.validPackage.create); |
40 | 50 |
41 integration('has an empty package name', () { | 51 integration('has an empty package name', () { |
42 d.dir(appPath, [d.libPubspec("", "1.0.0")]).create(); | 52 d.dir(appPath, [d.libPubspec("", "1.0.0")]).create(); |
43 expectValidationError(name); | 53 expectValidationError(name); |
44 }); | 54 }); |
45 | 55 |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 integration('has a single library named differently than the package', () { | 108 integration('has a single library named differently than the package', () { |
99 schedule(() => | 109 schedule(() => |
100 deleteEntry(path.join(sandboxDir, appPath, "lib", "test_pkg.dart"))); | 110 deleteEntry(path.join(sandboxDir, appPath, "lib", "test_pkg.dart"))); |
101 d.dir(appPath, [ | 111 d.dir(appPath, [ |
102 d.dir("lib", [d.file("best_pkg.dart", "int i = 0;")]) | 112 d.dir("lib", [d.file("best_pkg.dart", "int i = 0;")]) |
103 ]).create(); | 113 ]).create(); |
104 expectValidationWarning(name); | 114 expectValidationWarning(name); |
105 }); | 115 }); |
106 }); | 116 }); |
107 } | 117 } |
OLD | NEW |