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

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

Issue 19275012: Filter out accessors for fields. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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 test.reflect_model_test; 5 library test.reflect_model_test;
6 6
7 import 'dart:mirrors'; 7 import 'dart:mirrors';
8 8
9 import 'package:expect/expect.dart'; 9 import 'package:expect/expect.dart';
10 10
(...skipping 29 matching lines...) Expand all
40 Expect.equals(42, a.setField(field, 42).reflectee); 40 Expect.equals(42, a.setField(field, 42).reflectee);
41 Expect.equals(87, b.setField(field, 87).reflectee); 41 Expect.equals(87, b.setField(field, 87).reflectee);
42 Expect.equals(89, c.setField(field, 89).reflectee); 42 Expect.equals(89, c.setField(field, 89).reflectee);
43 43
44 Expect.equals(42, a.getField(field).reflectee); 44 Expect.equals(42, a.getField(field).reflectee);
45 Expect.equals('B:get field', b.getField(field).reflectee); 45 Expect.equals('B:get field', b.getField(field).reflectee);
46 Expect.equals('B:get field', c.getField(field).reflectee); 46 Expect.equals('B:get field', c.getField(field).reflectee);
47 Expect.equals(89, fieldC); 47 Expect.equals(89, fieldC);
48 48
49 expect('{accessor: Method(s(accessor) in s(A), getter)' 49 expect('{accessor: Method(s(accessor) in s(A), getter)'
50 // TODO(ahe): Include instance field getters?
51 ', field: Method(s(field) in s(A), getter)'
52 '}', 50 '}',
53 aClass.getters); 51 aClass.getters);
54 expect('{accessor: Method(s(accessor) in s(B), getter)' 52 expect('{accessor: Method(s(accessor) in s(B), getter)'
55 ', field: Method(s(field) in s(B), getter)}', 53 ', field: Method(s(field) in s(B), getter)}',
56 bClass.getters); 54 bClass.getters);
57 expect('{accessor: Method(s(accessor) in s(C), getter)}', 55 expect('{accessor: Method(s(accessor) in s(C), getter)}',
58 cClass.getters); 56 cClass.getters);
59 57
60 expect('{accessor=: Method(s(accessor=) in s(A), setter)' 58 expect('{accessor=: Method(s(accessor=) in s(A), setter)'
61 // TODO(ahe): Include instance field setters?
62 ', field=: Method(s(field=) in s(A), setter)'
63 '}', 59 '}',
64 aClass.setters); 60 aClass.setters);
65 expect('{accessor=: Method(s(accessor=) in s(B), setter)}', 61 expect('{accessor=: Method(s(accessor=) in s(B), setter)}',
66 bClass.setters); 62 bClass.setters);
67 expect('{accessor=: Method(s(accessor=) in s(C), setter)' 63 expect('{accessor=: Method(s(accessor=) in s(C), setter)'
68 ', field=: Method(s(field=) in s(C), setter)}', 64 ', field=: Method(s(field=) in s(C), setter)}',
69 cClass.setters); 65 cClass.setters);
70 66
71 Expect.equals('A:instanceMethod(7)', a.invoke(instanceMethod, [7]).reflectee); 67 Expect.equals('A:instanceMethod(7)', a.invoke(instanceMethod, [7]).reflectee);
72 Expect.equals('B:instanceMethod(9)', b.invoke(instanceMethod, [9]).reflectee); 68 Expect.equals('B:instanceMethod(9)', b.invoke(instanceMethod, [9]).reflectee);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 Expect.equals('aMethod', c.invoke(aMethod, []).reflectee); 100 Expect.equals('aMethod', c.invoke(aMethod, []).reflectee);
105 101
106 Expect.throws(() { a.invoke(bMethod, []); }, isNoSuchMethodError); 102 Expect.throws(() { a.invoke(bMethod, []); }, isNoSuchMethodError);
107 Expect.equals('bMethod', b.invoke(bMethod, []).reflectee); 103 Expect.equals('bMethod', b.invoke(bMethod, []).reflectee);
108 Expect.equals('bMethod', c.invoke(bMethod, []).reflectee); 104 Expect.equals('bMethod', c.invoke(bMethod, []).reflectee);
109 105
110 Expect.throws(() { a.invoke(cMethod, []); }, isNoSuchMethodError); 106 Expect.throws(() { a.invoke(cMethod, []); }, isNoSuchMethodError);
111 Expect.throws(() { b.invoke(cMethod, []); }, isNoSuchMethodError); 107 Expect.throws(() { b.invoke(cMethod, []); }, isNoSuchMethodError);
112 Expect.equals('cMethod', c.invoke(cMethod, []).reflectee); 108 Expect.equals('cMethod', c.invoke(cMethod, []).reflectee);
113 } 109 }
OLDNEW
« dart/sdk/lib/_internal/lib/js_mirrors.dart ('K') | « dart/sdk/lib/_internal/lib/js_mirrors.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698