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

Side by Side Diff: test/must_pub_get_test.dart

Issue 1956613002: Fix SDK constraints in lockfiles. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « lib/src/solver/version_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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:io'; 6 import 'dart:io';
7 7
8 import 'package:path/path.dart' as p; 8 import 'package:path/path.dart' as p;
9 import 'package:pub/src/exit_codes.dart' as exit_codes; 9 import 'package:pub/src/exit_codes.dart' as exit_codes;
10 import 'package:pub/src/io.dart'; 10 import 'package:pub/src/io.dart';
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 d.appPubspec({"foo": "1.0.0"}) 345 d.appPubspec({"foo": "1.0.0"})
346 ]).create(); 346 ]).create();
347 347
348 pubGet(); 348 pubGet();
349 349
350 _touch("pubspec.lock"); 350 _touch("pubspec.lock");
351 }); 351 });
352 352
353 _runsSuccessfully(); 353 _runsSuccessfully();
354 }); 354 });
355
356 group("an overridden dependency's SDK constraint is unmatched", () {
357 setUp(() {
358 globalPackageServer.add((builder) {
359 builder.serve("bar", "1.0.0", pubspec: {
360 "environment": {"sdk": "0.0.0-fake"}
361 });
362 });
363
364 d.dir(appPath, [
365 d.pubspec({
366 "name": "myapp",
367 "dependency_overrides": {"bar": "1.0.0"}
368 })
369 ]).create();
370
371 pubGet();
372
373 _touch("pubspec.lock");
374 });
375
376 _runsSuccessfully();
377 });
355 }); 378 });
356 } 379 }
357 380
358 /// Runs every command that care about the world being up-to-date, and asserts 381 /// Runs every command that care about the world being up-to-date, and asserts
359 /// that it prints [message] as part of its error. 382 /// that it prints [message] as part of its error.
360 void _requiresPubGet(String message) { 383 void _requiresPubGet(String message) {
361 for (var command in ["build", "serve", "run", "deps"]) { 384 for (var command in ["build", "serve", "run", "deps"]) {
362 integration("for pub $command", () { 385 integration("for pub $command", () {
363 var args = [command]; 386 var args = [command];
364 if (command == "run") args.add("script"); 387 if (command == "run") args.add("script");
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 void _touch(String path) { 439 void _touch(String path) {
417 schedule(() async { 440 schedule(() async {
418 // Delay a bit to make sure the modification times are noticeably different. 441 // Delay a bit to make sure the modification times are noticeably different.
419 // 1s seems to be the finest granularity that dart:io reports. 442 // 1s seems to be the finest granularity that dart:io reports.
420 await new Future.delayed(new Duration(seconds: 1)); 443 await new Future.delayed(new Duration(seconds: 1));
421 444
422 path = p.join(sandboxDir, "myapp", path); 445 path = p.join(sandboxDir, "myapp", path);
423 touch(path); 446 touch(path);
424 }, "touching $path"); 447 }, "touching $path");
425 } 448 }
OLDNEW
« no previous file with comments | « lib/src/solver/version_solver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698