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

Unified Diff: utils/tests/pub/install/hosted/repair_cache_test.dart

Issue 12225149: Auto-reinstall broken packages in the system cache. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Remove dead code. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « utils/pub/source.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/install/hosted/repair_cache_test.dart
diff --git a/utils/tests/pub/install/hosted/repair_cache_test.dart b/utils/tests/pub/install/hosted/repair_cache_test.dart
new file mode 100644
index 0000000000000000000000000000000000000000..8f2f79f4ac7a3d9b03a3fd7e72858c06f565c6bd
--- /dev/null
+++ b/utils/tests/pub/install/hosted/repair_cache_test.dart
@@ -0,0 +1,64 @@
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+library pub_tests;
+
+import '../../../../../pkg/path/lib/path.dart' as path;
+
+import '../../../../pub/io.dart';
+import '../../test_pub.dart';
+
+main() {
+ initConfig();
+ integration('re-installs a package if it has an empty "lib" directory', () {
+
+ servePackages([package("foo", "1.2.3")]);
+
+ // Set up a cache with a broken foo package.
+ dir(cachePath, [
+ dir('hosted', [
+ async(port.then((p) => dir('localhost%58$p', [
+ dir("foo-1.2.3", [
+ libPubspec("foo", "1.2.3"),
+ // Note: empty "lib" directory.
+ dir("lib", [])
+ ])
+ ])))
+ ])
+ ]).scheduleCreate();
+
+ appDir([dependency("foo", "1.2.3")]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: new RegExp("Dependencies installed!\$"));
+
+ cacheDir({"foo": "1.2.3"}).scheduleValidate();
+ packagesDir({"foo": "1.2.3"}).scheduleValidate();
+ });
+
+ integration('re-installs a package if it has no pubspec', () {
+
+ servePackages([package("foo", "1.2.3")]);
+
+ // Set up a cache with a broken foo package.
+ dir(cachePath, [
+ dir('hosted', [
+ async(port.then((p) => dir('localhost%58$p', [
+ dir("foo-1.2.3", [
+ libDir("foo")
+ // Note: no pubspec.
+ ])
+ ])))
+ ])
+ ]).scheduleCreate();
+
+ appDir([dependency("foo", "1.2.3")]).scheduleCreate();
+
+ schedulePub(args: ['install'],
+ output: new RegExp("Dependencies installed!\$"));
+
+ cacheDir({"foo": "1.2.3"}).scheduleValidate();
+ packagesDir({"foo": "1.2.3"}).scheduleValidate();
+ });
+}
« no previous file with comments | « utils/pub/source.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698