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

Side by Side Diff: sdk/lib/_internal/pub/test/version_solver_test.dart

Issue 112473002: Don't crash if a failed dependency is in the root package. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years 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
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library pub_upgrade_test; 5 library pub_upgrade_test;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:unittest/unittest.dart'; 9 import 'package:unittest/unittest.dart';
10 10
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 'a 2.0.0': { 395 'a 2.0.0': {
396 'b': '2.0.0' 396 'b': '2.0.0'
397 }, 397 },
398 'b 1.0.0': { 398 'b 1.0.0': {
399 'a': '2.0.0' 399 'a': '2.0.0'
400 }, 400 },
401 'b 2.0.0': { 401 'b 2.0.0': {
402 'a': '1.0.0' 402 'a': '1.0.0'
403 } 403 }
404 }, error: couldNotSolve, maxTries: 4); 404 }, error: couldNotSolve, maxTries: 4);
405
406 // This is a regression test for #15550.
407 testResolve('no version that matches while backtracking', {
408 'myapp 0.0.0': {
409 'a': 'any',
410 'b': '>1.0.0'
411 },
412 'a 1.0.0': {},
413 'b 1.0.0': {}
414 }, error: noVersion(['myapp']), maxTries: 1);
405 } 415 }
406 416
407 badSource() { 417 badSource() {
408 testResolve('fail if the root package has a bad source in dep', { 418 testResolve('fail if the root package has a bad source in dep', {
409 'myapp 0.0.0': { 419 'myapp 0.0.0': {
410 'foo from bad': 'any' 420 'foo from bad': 'any'
411 }, 421 },
412 }, error: unknownSource('myapp', 'foo', 'bad')); 422 }, error: unknownSource('myapp', 'foo', 'bad'));
413 423
414 testResolve('fail if the root package has a bad source in dev dep', { 424 testResolve('fail if the root package has a bad source in dev dep', {
(...skipping 970 matching lines...) Expand 10 before | Expand all | Expand 10 after
1385 } 1395 }
1386 1396
1387 var source = "mock1"; 1397 var source = "mock1";
1388 if (match[7] != null) { 1398 if (match[7] != null) {
1389 source = match[7]; 1399 source = match[7];
1390 if (source == "root") source = null; 1400 if (source == "root") source = null;
1391 } 1401 }
1392 1402
1393 return new PackageId(name, source, parsedVersion, description); 1403 return new PackageId(name, source, parsedVersion, description);
1394 } 1404 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/pub/lib/src/solver/backtracking_solver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698