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

Unified Diff: utils/tests/pub/test_pub.dart

Issue 12092080: Validate packages against their SDK constraints. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revise. Created 7 years, 11 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
Index: utils/tests/pub/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index 27708ff19bb8c49029d5a3d33da02b2b49893ef2..38d130cb48ed0a300c5f96e4e992937c4f98f1c9 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -243,9 +243,19 @@ Descriptor appPubspec(List dependencies) {
}
/// Describes a file named `pubspec.yaml` for a library package with the given
-/// [name], [version], and [dependencies].
-Descriptor libPubspec(String name, String version, [List dependencies]) =>
- pubspec(package(name, version, dependencies));
+/// [name], [version], and [deps]. If "sdk" is given, then it adds an SDK
+/// constraint on that version.
+Descriptor libPubspec(String name, String version, {List deps, String sdk}) {
+ var map = package(name, version, deps);
+
+ if (sdk != null) {
+ map["environment"] = {
+ "sdk": sdk
+ };
+ }
+
+ return pubspec(map);
+}
/// Describes a directory named `lib` containing a single dart file named
/// `<name>.dart` that contains a line of Dart code.
@@ -467,6 +477,11 @@ final _TIMEOUT = 30000;
/// operations which will be run asynchronously.
void integration(String description, void body()) {
test(description, () {
+ // Ensure the SDK version is always available.
+ dir(sdkPath, [
+ file('version', '0.1.2.3')
+ ]).scheduleCreate();
+
// Schedule the test.
body();
« no previous file with comments | « utils/tests/pub/sdk_constraint_test.dart ('k') | utils/tests/pub/update/git/do_not_update_if_unneeded_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698