Index: sdk/lib/_internal/pub/test/pubspec_test.dart |
diff --git a/sdk/lib/_internal/pub/test/pubspec_test.dart b/sdk/lib/_internal/pub/test/pubspec_test.dart |
index 47f838a0a7f2fb895a1e9e4f8ac3ce7e6c6748bf..e7608b4cfc375908fd99a6d71b58439d4ac6c997 100644 |
--- a/sdk/lib/_internal/pub/test/pubspec_test.dart |
+++ b/sdk/lib/_internal/pub/test/pubspec_test.dart |
@@ -111,10 +111,40 @@ dependencies: |
'''); |
}); |
+ test("throws if dependency version is not a string", () { |
+ expectFormatError(''' |
+dependencies: |
+ foo: |
+ mock: ok |
+ version: 1.2 |
+'''); |
+ }); |
+ |
+ test("throws if version is not a version constraint", () { |
+ expectFormatError(''' |
+dependencies: |
+ foo: |
+ mock: ok |
+ version: not constraint |
+'''); |
+ }); |
+ |
test("throws if 'name' is not a string", () { |
expectFormatError('name: [not, a, string]'); |
}); |
+ test("throws if version is not a string", () { |
+ expectFormatError(''' |
+version: 1.0 |
+'''); |
+ }); |
+ |
+ test("throws if version is not a version", () { |
+ expectFormatError(''' |
+version: not version |
+'''); |
+ }); |
+ |
test("throws if 'homepage' is not a string", () { |
expectFormatError('homepage:'); |
expectFormatError('homepage: [not, a, string]'); |
@@ -212,6 +242,13 @@ environment: |
'''); |
}); |
+ test("throws if the sdk is not a string", () { |
+ expectFormatError(''' |
+environment: |
+ sdk: 1.0 |
+'''); |
+ }); |
+ |
test("throws if the sdk isn't a valid version constraint", () { |
expectFormatError(''' |
environment: |