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

Side by Side Diff: test/runner/compact_reporter_test.dart

Issue 2091173002: Add metadata to messages emitted by live tests. (Closed) Base URL: git@github.com:dart-lang/test@master
Patch Set: Created 4 years, 5 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 | « test/runner/browser/loader_test.dart ('k') | test/runner/json_reporter_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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 'package:scheduled_test/descriptor.dart' as d; 7 import 'package:scheduled_test/descriptor.dart' as d;
8 import 'package:scheduled_test/scheduled_stream.dart'; 8 import 'package:scheduled_test/scheduled_stream.dart';
9 import 'package:scheduled_test/scheduled_test.dart'; 9 import 'package:scheduled_test/scheduled_test.dart';
10 10
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 +2 ~2 -2: Some tests failed."""); 388 +2 ~2 -2: Some tests failed.""");
389 }); 389 });
390 390
391 test("displays the skip reason if available", () { 391 test("displays the skip reason if available", () {
392 _expectReport(""" 392 _expectReport("""
393 test('skip 1', () {}, skip: 'some reason'); 393 test('skip 1', () {}, skip: 'some reason');
394 test('skip 2', () {}, skip: 'or another');""", 394 test('skip 2', () {}, skip: 'or another');""",
395 """ 395 """
396 +0: loading test.dart 396 +0: loading test.dart
397 +0: skip 1 397 +0: skip 1
398 +0 ~1: skip 1
399 Skip: some reason 398 Skip: some reason
400 399
400 +0 ~1: skip 1
401 +0 ~1: skip 2 401 +0 ~1: skip 2
402 +0 ~2: skip 2
403 Skip: or another 402 Skip: or another
404 403
404 +0 ~2: skip 2
405 +0 ~2: All tests skipped."""); 405 +0 ~2: All tests skipped.""");
406 }); 406 });
407 }); 407 });
408 } 408 }
409 409
410 void _expectReport(String tests, String expected) { 410 void _expectReport(String tests, String expected) {
411 var dart = """ 411 var dart = """
412 import 'dart:async'; 412 import 'dart:async';
413 413
414 import 'package:test/test.dart'; 414 import 'package:test/test.dart';
(...skipping 30 matching lines...) Expand all
445 // Un-indent the expected string. 445 // Un-indent the expected string.
446 var indentation = expected.indexOf(new RegExp("[^ ]")); 446 var indentation = expected.indexOf(new RegExp("[^ ]"));
447 expected = expected.split("\n").map((line) { 447 expected = expected.split("\n").map((line) {
448 if (line.isEmpty) return line; 448 if (line.isEmpty) return line;
449 return line.substring(indentation); 449 return line.substring(indentation);
450 }).join("\n"); 450 }).join("\n");
451 451
452 expect(actual, equals(expected)); 452 expect(actual, equals(expected));
453 }); 453 });
454 } 454 }
OLDNEW
« no previous file with comments | « test/runner/browser/loader_test.dart ('k') | test/runner/json_reporter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698