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

Unified Diff: test/pubspec_test.dart

Issue 2079303003: Track Source objects in PackageNames. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 4 years, 6 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/lock_file_test.dart ('k') | test/test_pub.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/pubspec_test.dart
diff --git a/test/pubspec_test.dart b/test/pubspec_test.dart
index 24a68be46922b0b6c3aceac77dae3ba6518cbf21..480ad50c9987c2d9422a0a5799f907be54e3864e 100644
--- a/test/pubspec_test.dart
+++ b/test/pubspec_test.dart
@@ -19,15 +19,17 @@ class MockSource extends Source {
PackageRef parseRef(String name, description, {String containingPath}) {
if (description != 'ok') throw new FormatException('Bad');
- return new PackageRef(name, this.name, description);
+ return new PackageRef(name, this, description);
}
PackageId parseId(String name, Version version, description) =>
- new PackageId(name, this.name, version, description);
+ new PackageId(name, this, version, description);
bool descriptionsEqual(description1, description2) =>
description1 == description2;
+ int hashDescription(description) => description.hashCode;
+
String packageName(description) => 'foo';
}
@@ -147,7 +149,7 @@ dependencies:
var foo = pubspec.dependencies[0];
expect(foo.name, equals('foo'));
- expect(foo.source, equals('unknown'));
+ expect(foo.source, equals(sources['unknown']));
});
test("throws if a package is in dependencies and dev_dependencies", () {
« no previous file with comments | « test/lock_file_test.dart ('k') | test/test_pub.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698