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

Side by Side 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 unified diff | 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 @TestOn("vm") 5 @TestOn("vm")
6 6
7 import 'dart:convert'; 7 import 'dart:convert';
8 8
9 import 'package:scheduled_test/descriptor.dart' as d; 9 import 'package:scheduled_test/descriptor.dart' as d;
10 import 'package:scheduled_test/scheduled_test.dart'; 10 import 'package:scheduled_test/scheduled_test.dart';
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 "platforms": ["foo"] 151 "platforms": ["foo"]
152 })).create(); 152 })).create();
153 153
154 var test = runTest(["test.dart"]); 154 var test = runTest(["test.dart"]);
155 test.stderr.expect(containsInOrder([ 155 test.stderr.expect(containsInOrder([
156 'Unknown platform "foo"', 156 'Unknown platform "foo"',
157 "^^^^^" 157 "^^^^^"
158 ])); 158 ]));
159 test.shouldExit(exit_codes.data); 159 test.shouldExit(exit_codes.data);
160 }); 160 });
161
162 test("rejects an invalid paths list type", () {
163 d.file("dart_test.yaml", JSON.encode({
164 "paths": "test"
165 })).create();
166
167 var test = runTest(["test.dart"]);
168 test.stderr.expect(containsInOrder([
169 "paths must be a list",
170 "^^^^^^"
171 ]));
172 test.shouldExit(exit_codes.data);
173 });
174
175 test("rejects an invalid paths member type", () {
176 d.file("dart_test.yaml", JSON.encode({
177 "paths": [12]
178 })).create();
179
180 var test = runTest(["test.dart"]);
181 test.stderr.expect(containsInOrder([
182 "Paths must be strings",
183 "^^"
184 ]));
185 test.shouldExit(exit_codes.data);
186 });
187
188 test("rejects an absolute path", () {
189 d.file("dart_test.yaml", JSON.encode({
190 "paths": ["/foo"]
191 })).create();
192
193 var test = runTest(["test.dart"]);
194 test.stderr.expect(containsInOrder([
195 'Paths must be relative.',
196 "^^^^^^"
197 ]));
198 test.shouldExit(exit_codes.data);
199 });
200
201 test("rejects an invalid path URI", () {
202 d.file("dart_test.yaml", JSON.encode({
203 "paths": ["[invalid]"]
204 })).create();
205
206 var test = runTest(["test.dart"]);
207 test.stderr.expect(containsInOrder([
208 'Invalid path: Invalid character',
209 "^^^^^^^^^"
210 ]));
211 test.shouldExit(exit_codes.data);
212 });
213
214 test("rejects an invalid filename type", () {
215 d.file("dart_test.yaml", JSON.encode({
216 "filename": 12
217 })).create();
218
219 var test = runTest(["test.dart"]);
220 test.stderr.expect(containsInOrder([
221 'filename must be a string.',
222 "^^"
223 ]));
224 test.shouldExit(exit_codes.data);
225 });
226
227 test("rejects an invalid filename format", () {
228 d.file("dart_test.yaml", JSON.encode({
229 "filename": "{foo"
230 })).create();
231
232 var test = runTest(["test.dart"]);
233 test.stderr.expect(containsInOrder([
234 'Invalid filename: expected ",".',
235 "^^^^^^"
236 ]));
237 test.shouldExit(exit_codes.data);
238 });
161 } 239 }
OLDNEW
« 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