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

Side by Side Diff: pkg/analyzer/test/reflective_tests.dart

Issue 749083005: Keep full test_ method names in reflective tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analysis_server/test/reflective_tests.dart ('k') | no next file » | 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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 library reflective_tests; 5 library reflective_tests;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:mirrors'; 8 import 'dart:mirrors';
9 9
10 import 'package:unittest/unittest.dart'; 10 import 'package:unittest/unittest.dart';
(...skipping 20 matching lines...) Expand all
31 String className = MirrorSystem.getName(classMirror.simpleName); 31 String className = MirrorSystem.getName(classMirror.simpleName);
32 group(className, () { 32 group(className, () {
33 classMirror.instanceMembers.forEach((symbol, memberMirror) { 33 classMirror.instanceMembers.forEach((symbol, memberMirror) {
34 // we need only methods 34 // we need only methods
35 if (memberMirror is! MethodMirror || !memberMirror.isRegularMethod) { 35 if (memberMirror is! MethodMirror || !memberMirror.isRegularMethod) {
36 return; 36 return;
37 } 37 }
38 String memberName = MirrorSystem.getName(symbol); 38 String memberName = MirrorSystem.getName(symbol);
39 // test_ 39 // test_
40 if (memberName.startsWith('test_')) { 40 if (memberName.startsWith('test_')) {
41 String testName = memberName.substring('test_'.length); 41 test(memberName, () {
42 test(testName, () {
43 return _runTest(classMirror, symbol); 42 return _runTest(classMirror, symbol);
44 }); 43 });
45 return; 44 return;
46 } 45 }
47 // solo_test_ 46 // solo_test_
48 if (memberName.startsWith('solo_test_')) { 47 if (memberName.startsWith('solo_test_')) {
49 String testName = memberName.substring('solo_test_'.length); 48 solo_test(memberName, () {
50 solo_test(testName, () {
51 return _runTest(classMirror, symbol); 49 return _runTest(classMirror, symbol);
52 }); 50 });
53 } 51 }
54 }); 52 });
55 }); 53 });
56 } 54 }
57 55
58 56
59 Future _invokeSymbolIfExists(InstanceMirror instanceMirror, Symbol symbol) { 57 Future _invokeSymbolIfExists(InstanceMirror instanceMirror, Symbol symbol) {
60 var invocationResult = null; 58 var invocationResult = null;
(...skipping 23 matching lines...) Expand all
84 } 82 }
85 83
86 84
87 /** 85 /**
88 * A marker annotation used to instruct dart2js to keep reflection information 86 * A marker annotation used to instruct dart2js to keep reflection information
89 * for the annotated classes. 87 * for the annotated classes.
90 */ 88 */
91 class ReflectiveTestCase { 89 class ReflectiveTestCase {
92 const ReflectiveTestCase(); 90 const ReflectiveTestCase();
93 } 91 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/reflective_tests.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698