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

Side by Side Diff: tests/lib/mirrors/parameter_dart2js_test.dart

Issue 24008002: Merge tests for dart2js and VM using multi-tests. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rebase Created 7 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « tests/lib/mirrors/equality_test.dart ('k') | tests/lib/mirrors/parameter_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
(Empty)
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
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.
4
5 /// Test of [ParameterMirror].
6 library test.parameter_test;
7
8 @MirrorsUsed(targets: 'test.parameter_test', override: '*')
9 import 'dart:mirrors';
10
11 import 'stringify.dart';
12
13 class B {
14 B();
15 B.foo(int x);
16 B.bar(int z, x);
17 }
18
19 main() {
20 var constructors = reflectClass(B).constructors;
21
22 expect('{B: Method(s(B) in s(B), constructor), '
23 'B.bar: Method(s(B.bar) in s(B), constructor), '
24 'B.foo: Method(s(B.foo) in s(B), constructor)}',
25 constructors);
26
27 var unnamedConstructor = constructors[new Symbol('B')];
28
29 expect('[]', unnamedConstructor.parameters);
30 expect('Class(s(B) in s(test.parameter_test), top-level)',
31 unnamedConstructor.returnType);
32
33 var fooConstructor = constructors[new Symbol('B.foo')];
34 expect('[Parameter(s(x) in s(B.foo),'
35 ' type = Class(s(int) in s(dart.core), top-level))]',
36 fooConstructor.parameters);
37 expect('Class(s(B) in s(test.parameter_test), top-level)',
38 fooConstructor.returnType);
39
40 var barConstructor = constructors[new Symbol('B.bar')];
41 expect('[Parameter(s(z) in s(B.bar),'
42 ' type = Class(s(int) in s(dart.core), top-level)), '
43 'Parameter(s(x) in s(B.bar),'
44 ' type = Type(s(dynamic), top-level))]',
45 barConstructor.parameters);
46 expect('Class(s(B) in s(test.parameter_test), top-level)',
47 barConstructor.returnType);
48
49 print(constructors);
50 }
OLDNEW
« no previous file with comments | « tests/lib/mirrors/equality_test.dart ('k') | tests/lib/mirrors/parameter_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698