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

Unified Diff: sdk/lib/_internal/pub/test/pub_cache_test.dart

Issue 15347004: Gracefully handle pubspecs with dependencies using unknown sources. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Add tests for unknown sources in lockfiles. Created 7 years, 7 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 | « sdk/lib/_internal/pub/test/lock_file_test.dart ('k') | sdk/lib/_internal/pub/test/pubspec_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/pub/test/pub_cache_test.dart
diff --git a/sdk/lib/_internal/pub/test/pub_cache_test.dart b/sdk/lib/_internal/pub/test/pub_cache_test.dart
index 6166514bdf7f5a77e931fe61158afe329239d35d..cb38da7d25a6145b9c5c96fb78679b23a78002e2 100644
--- a/sdk/lib/_internal/pub/test/pub_cache_test.dart
+++ b/sdk/lib/_internal/pub/test/pub_cache_test.dart
@@ -15,9 +15,9 @@ import 'test_pub.dart';
main() {
initConfig();
-
+
integration('running pub cache displays error message', () {
- schedulePub(args: ['cache'],
+ schedulePub(args: ['cache'],
output: '''
Inspect the system cache.
@@ -26,9 +26,9 @@ main() {
error: 'The cache command expects one argument.',
exitCode: 64);
});
-
+
integration('running pub cache foo displays error message', () {
- schedulePub(args: ['cache' ,'foo'],
+ schedulePub(args: ['cache' ,'foo'],
output: '''
Inspect the system cache.
@@ -37,12 +37,12 @@ main() {
error: 'Unknown cache command "foo".',
exitCode: 64);
});
-
- integration('running pub cache list when there is no cache', () {
+
+ integration('running pub cache list when there is no cache', () {
schedulePub(args: ['cache', 'list'], output: '{"packages":{}}');
});
-
- integration('running pub cache list on empty cache', () {
+
+ integration('running pub cache list on empty cache', () {
// Set up a cache.
d.dir(cachePath, [
d.dir('hosted', [
@@ -50,10 +50,10 @@ main() {
])
])
]).create();
-
+
schedulePub(args: ['cache', 'list'], output: '{"packages":{}}');
});
-
+
integration('running pub cache list', () {
// Set up a cache.
d.dir(cachePath, [
@@ -69,11 +69,28 @@ main() {
])
])
]).create();
-
- schedulePub(args: ['cache', 'list'], output:
+
+ schedulePub(args: ['cache', 'list'], output:
new RegExp(r'\{"packages":\{"bar":\{"version":"2\.0\.0","location":'
r'"[^"]+bar-2\.0\.0"\},"foo":\{"version":"1\.2\.3","location":'
r'"[^"]+foo-1\.2\.3"\}\}\}$'));
});
-
+
+ integration('includes packages containing deps with bad sources', () {
+ // Set up a cache.
+ d.dir(cachePath, [
+ d.dir('hosted', [
+ d.dir('pub.dartlang.org', [
+ d.dir("foo-1.2.3", [
+ d.libPubspec("foo", "1.2.3", deps: [{"bad": "bar"}]),
+ d.libDir("foo")
+ ])
+ ])
+ ])
+ ]).create();
+
+ schedulePub(args: ['cache', 'list'], output:
+ new RegExp(r'\{"packages":\{"foo":\{"version":"1\.2\.3","location":'
+ r'"[^"]+foo-1\.2\.3"\}\}\}$'));
+ });
}
« no previous file with comments | « sdk/lib/_internal/pub/test/lock_file_test.dart ('k') | sdk/lib/_internal/pub/test/pubspec_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698