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

Unified Diff: test/runner/configuration/top_level_error_test.dart

Issue 1668573003: Add configuration support for choosing test paths. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: cr Created 4 years, 10 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 | « lib/src/runner/loader.dart ('k') | test/runner/configuration/top_level_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/runner/configuration/top_level_error_test.dart
diff --git a/test/runner/configuration/top_level_error_test.dart b/test/runner/configuration/top_level_error_test.dart
index 84ba460b62731ac271c8d6eb4d26ce3e2b364f4b..79300325218d62f24661839f3f239161c9558229 100644
--- a/test/runner/configuration/top_level_error_test.dart
+++ b/test/runner/configuration/top_level_error_test.dart
@@ -158,4 +158,82 @@ void main() {
]));
test.shouldExit(exit_codes.data);
});
+
+ test("rejects an invalid paths list type", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "paths": "test"
+ })).create();
+
+ var test = runTest(["test.dart"]);
+ test.stderr.expect(containsInOrder([
+ "paths must be a list",
+ "^^^^^^"
+ ]));
+ test.shouldExit(exit_codes.data);
+ });
+
+ test("rejects an invalid paths member type", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "paths": [12]
+ })).create();
+
+ var test = runTest(["test.dart"]);
+ test.stderr.expect(containsInOrder([
+ "Paths must be strings",
+ "^^"
+ ]));
+ test.shouldExit(exit_codes.data);
+ });
+
+ test("rejects an absolute path", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "paths": ["/foo"]
+ })).create();
+
+ var test = runTest(["test.dart"]);
+ test.stderr.expect(containsInOrder([
+ 'Paths must be relative.',
+ "^^^^^^"
+ ]));
+ test.shouldExit(exit_codes.data);
+ });
+
+ test("rejects an invalid path URI", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "paths": ["[invalid]"]
+ })).create();
+
+ var test = runTest(["test.dart"]);
+ test.stderr.expect(containsInOrder([
+ 'Invalid path: Invalid character',
+ "^^^^^^^^^"
+ ]));
+ test.shouldExit(exit_codes.data);
+ });
+
+ test("rejects an invalid filename type", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "filename": 12
+ })).create();
+
+ var test = runTest(["test.dart"]);
+ test.stderr.expect(containsInOrder([
+ 'filename must be a string.',
+ "^^"
+ ]));
+ test.shouldExit(exit_codes.data);
+ });
+
+ test("rejects an invalid filename format", () {
+ d.file("dart_test.yaml", JSON.encode({
+ "filename": "{foo"
+ })).create();
+
+ var test = runTest(["test.dart"]);
+ test.stderr.expect(containsInOrder([
+ 'Invalid filename: expected ",".',
+ "^^^^^^"
+ ]));
+ test.shouldExit(exit_codes.data);
+ });
}
« no previous file with comments | « lib/src/runner/loader.dart ('k') | test/runner/configuration/top_level_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698