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

Unified Diff: test/lock_file_test.dart

Issue 1528523003: Clean up the semantics of package descriptions. (Closed) Base URL: git@github.com:dart-lang/pub.git@master
Patch Set: Code review changes Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/get/git/require_pubspec_test.dart ('k') | test/pubspec_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/lock_file_test.dart
diff --git a/test/lock_file_test.dart b/test/lock_file_test.dart
index 894016e09e7b39c960697ed6d5c1a078395e7e19..4cb5751b1a4239c90d070126d5df68eed67c7f66 100644
--- a/test/lock_file_test.dart
+++ b/test/lock_file_test.dart
@@ -20,6 +20,9 @@ import 'test_pub.dart';
class MockSource extends Source {
final String name = 'mock';
+ Future<List<PackageId>> doGetVersions(PackageRef ref) =>
+ throw new UnsupportedError("Cannot get mock package versions.");
+
Future<Pubspec> doDescribe(PackageId id) => throw new UnsupportedError(
"Cannot describe mock packages.");
@@ -29,10 +32,14 @@ class MockSource extends Source {
String getDirectory(PackageId id) => throw new UnsupportedError(
"Cannot get the directory for mock packages.");
- dynamic parseDescription(String filePath, String description,
- {bool fromLockFile: false}) {
- if (!description.endsWith(' desc')) throw new FormatException();
- return description;
+ PackageRef parseRef(String name, description, {String containingPath}) {
+ if (!description.endsWith(' desc')) throw new FormatException('Bad');
+ return new PackageRef(name, this.name, description);
+ }
+
+ PackageId parseId(String name, Version version, description) {
+ if (!description.endsWith(' desc')) throw new FormatException('Bad');
+ return new PackageId(name, this.name, version, description);
}
bool descriptionsEqual(description1, description2) =>
« no previous file with comments | « test/get/git/require_pubspec_test.dart ('k') | test/pubspec_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698