OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2014, 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 'package:scheduled_test/scheduled_test.dart'; | |
6 | |
7 import 'package:pub/src/exit_codes.dart' as exit_codes; | |
8 | |
9 import '../descriptor.dart' as d; | |
10 import '../test_pub.dart'; | |
11 | |
12 main() { | |
13 integration("pub get fails with a non-identifier name", () { | |
14 d.dir(appPath, [ | |
15 d.pubspec({ | |
16 "name": "invalid package name", | |
17 "version": "1.0.0" | |
18 }) | |
19 ]).create(); | |
20 | |
21 pubGet( | |
22 error: contains('"name" field must be a valid Dart identifier.'), | |
23 exitCode: exit_codes.DATA); | |
24 | |
25 d.dir(appPath, [ | |
26 // The lockfile should not be created. | |
27 d.nothing("pubspec.lock"), | |
28 // The "packages" directory should not have been generated. | |
29 d.nothing("packages"), | |
30 // The ".packages" file should not have been created. | |
31 d.nothing(".packages"), | |
32 ]).validate(); | |
33 }); | |
34 | |
35 integration("pub get fails with a reserved word name", () { | |
36 d.dir(appPath, [ | |
37 d.pubspec({ | |
38 "name": "return", | |
39 "version": "1.0.0" | |
40 }) | |
41 ]).create(); | |
42 | |
43 pubGet( | |
44 error: contains('"name" field may not be a Dart reserved word.'), | |
45 exitCode: exit_codes.DATA); | |
46 | |
47 d.dir(appPath, [ | |
48 // The lockfile should not be created. | |
49 d.nothing("pubspec.lock"), | |
50 // The "packages" directory should not have been generated. | |
51 d.nothing("packages"), | |
52 // The ".packages" file should not have been created. | |
53 d.nothing(".packages"), | |
54 ]).validate(); | |
55 }); | |
56 | |
57 integration("pub get allows a name with dotted identifiers", () { | |
58 d.dir(appPath, [ | |
59 d.pubspec({ | |
60 "name": "foo.bar.baz", | |
61 "version": "1.0.0" | |
62 }), | |
63 d.libDir("foo.bar.baz", "foo.bar.baz 1.0.0") | |
64 ]).create(); | |
65 | |
66 pubGet(); | |
67 | |
68 d.packagesDir({"foo.bar.baz": "1.0.0"}).validate(); | |
69 }); | |
Bob Nystrom
2015/12/01 23:21:15
What about "for.if.return"?
nweiz
2015/12/02 00:29:01
I don't particularly mind if someone does that. On
| |
70 } | |
OLD | NEW |