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

Unified Diff: test/version_solver_test.dart

Issue 1281043004: Make LockFile immutable. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 years, 4 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 | « test/test_pub.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/version_solver_test.dart
diff --git a/test/version_solver_test.dart b/test/version_solver_test.dart
index 070d82897ad9386318d25938e94a3231568b00e1..1ddacafc1f8c719dd66a62b70ecf9bae9d310d24 100644
--- a/test/version_solver_test.dart
+++ b/test/version_solver_test.dart
@@ -1166,13 +1166,14 @@ _testResolve(void testFn(String description, Function body),
}
// Parse the lockfile.
- var realLockFile = new LockFile.empty();
- if (lockfile != null) {
- lockfile.forEach((name, version) {
- version = new Version.parse(version);
- realLockFile.packages[name] =
- new PackageId(name, source1.name, version, name);
- });
+ var realLockFile;
+ if (lockfile == null) {
+ realLockFile = new LockFile.empty(cache.sources);
+ } else {
+ realLockFile = new LockFile(lockfile.keys.map((name) {
+ var version = new Version.parse(lockfile[name]);
+ return new PackageId(name, source1.name, version, name);
+ }), cache.sources);
}
// Resolve the versions.
« no previous file with comments | « test/test_pub.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698