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

Side by Side Diff: sdk/lib/_internal/pub_generated/test/unknown_source_test.dart

Issue 887223007: Revert "Use native async/await support in pub." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS d.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 d.file.
4
5 library pub_tests;
6
7 import 'dart:convert';
8
9 import 'descriptor.dart' as d;
10 import 'test_pub.dart';
11
12 main() {
13 initConfig();
14
15 forBothPubGetAndUpgrade((command) {
16 integration('fails gracefully on a dependency from an unknown source', () {
17 d.appDir({
18 "foo": {
19 "bad": "foo"
20 }
21 }).create();
22
23 pubCommand(
24 command,
25 error: 'Package myapp depends on foo from unknown source "bad".');
26 });
27
28 integration(
29 'fails gracefully on transitive dependency from an unknown ' 'source',
30 () {
31 d.dir(
32 'foo',
33 [d.libDir('foo', 'foo 0.0.1'), d.libPubspec('foo', '0.0.1', deps: {
34 "bar": {
35 "bad": "bar"
36 }
37 })]).create();
38
39 d.appDir({
40 "foo": {
41 "path": "../foo"
42 }
43 }).create();
44
45 pubCommand(
46 command,
47 error: 'Package foo depends on bar from unknown source "bad".');
48 });
49
50 integration('ignores unknown source in lockfile', () {
51 d.dir('foo', [d.libDir('foo'), d.libPubspec('foo', '0.0.1')]).create();
52
53 // Depend on "foo" from a valid source.
54 d.dir(appPath, [d.appPubspec({
55 "foo": {
56 "path": "../foo"
57 }
58 })]).create();
59
60 // But lock it to a bad one.
61 d.dir(appPath, [d.file("pubspec.lock", JSON.encode({
62 'packages': {
63 'foo': {
64 'version': '0.0.0',
65 'source': 'bad',
66 'description': {
67 'name': 'foo'
68 }
69 }
70 }
71 }))]).create();
72
73 pubCommand(command);
74
75 // Should upgrade to the new one.
76 d.dir(
77 packagesPath,
78 [d.dir("foo", [d.file("foo.dart", 'main() => "foo";')])]).validate();
79 });
80 });
81 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698