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

Side by Side Diff: utils/tests/pub/validator/lib_test.dart

Issue 14297021: Move pub into sdk/lib/_internal. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Disallow package: imports of pub. Created 7 years, 8 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
OLDNEW
(Empty)
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
3 // BSD-style license that can be found in the LICENSE file.
4
5 import 'package:pathos/path.dart' as path;
6 import 'package:scheduled_test/scheduled_test.dart';
7
8 import '../../../pub/entrypoint.dart';
9 import '../../../pub/io.dart';
10 import '../../../pub/validator.dart';
11 import '../../../pub/validator/lib.dart';
12 import '../descriptor.dart' as d;
13 import '../test_pub.dart';
14 import 'utils.dart';
15
16 Validator lib(Entrypoint entrypoint) => new LibValidator(entrypoint);
17
18 main() {
19 initConfig();
20
21 group('should consider a package valid if it', () {
22 setUp(d.validPackage.create);
23
24 integration('looks normal', () => expectNoValidationError(lib));
25
26 integration('has a non-Dart file in lib', () {
27 d.dir(appPath, [
28 d.libPubspec("test_pkg", "1.0.0"),
29 d.dir("lib", [
30 d.file("thing.txt", "woo hoo")
31 ])
32 ]).create();
33 expectNoValidationError(lib);
34 });
35 });
36
37 group('should consider a package invalid if it', () {
38 setUp(d.validPackage.create);
39
40 integration('has no lib directory', () {
41 schedule(() => deleteEntry(path.join(sandboxDir, appPath, "lib")));
42 expectValidationError(lib);
43 });
44
45 integration('has an empty lib directory', () {
46 schedule(() =>
47 deleteEntry(path.join(sandboxDir, appPath, "lib", "test_pkg.dart")));
48 expectValidationError(lib);
49 });
50
51 integration('has a lib directory containing only src', () {
52 schedule(() =>
53 deleteEntry(path.join(sandboxDir, appPath, "lib", "test_pkg.dart")));
54 d.dir(appPath, [
55 d.dir("lib", [
56 d.dir("src", [d.file("test_pkg.dart", "int i = 0;")])
57 ])
58 ]).create();
59 expectValidationError(lib);
60 });
61 });
62 }
OLDNEW
« no previous file with comments | « utils/tests/pub/validator/directory_test.dart ('k') | utils/tests/pub/validator/license_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698