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

Unified Diff: pkg/smoke/test/common.dart

Issue 173473002: Adapting observe to use smoke (this is built on top of the previous change that (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/smoke/lib/static.dart ('k') | pkg/smoke/test/static_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/smoke/test/common.dart
diff --git a/pkg/smoke/test/common.dart b/pkg/smoke/test/common.dart
index d6b1fb29d3babf9b9ceeddac95e982c78eefe826..85c28946af98cf1d731a47d35d077a89ec5ab585 100644
--- a/pkg/smoke/test/common.dart
+++ b/pkg/smoke/test/common.dart
@@ -140,7 +140,8 @@ main() {
test('get declaration', () {
var d = smoke.getDeclaration(B, #a);
expect(d.name, #a);
- expect(d.isProperty, isTrue);
+ expect(d.isField, isTrue);
+ expect(d.isProperty, isFalse);
expect(d.isMethod, isFalse);
expect(d.isFinal, isFalse);
expect(d.isStatic, isFalse);
@@ -149,6 +150,7 @@ main() {
d = smoke.getDeclaration(B, #w);
expect(d.name, #w);
+ expect(d.isField, isFalse);
expect(d.isProperty, isTrue);
expect(d.isMethod, isFalse);
expect(d.isFinal, isFalse);
@@ -158,6 +160,7 @@ main() {
d = smoke.getDeclaration(A, #inc1);
expect(d.name, #inc1);
+ expect(d.isField, isFalse);
expect(d.isProperty, isFalse);
expect(d.isMethod, isTrue);
expect(d.isFinal, isFalse);
@@ -167,6 +170,7 @@ main() {
d = smoke.getDeclaration(F, #staticMethod);
expect(d.name, #staticMethod);
+ expect(d.isField, isFalse);
expect(d.isProperty, isFalse);
expect(d.isMethod, isTrue);
expect(d.isFinal, isFalse);
@@ -176,7 +180,8 @@ main() {
d = smoke.getDeclaration(G, #b);
expect(d.name, #b);
- expect(d.isProperty, isTrue);
+ expect(d.isField, isTrue);
+ expect(d.isProperty, isFalse);
expect(d.isMethod, isFalse);
expect(d.isFinal, isFalse);
expect(d.isStatic, isFalse);
@@ -185,7 +190,8 @@ main() {
d = smoke.getDeclaration(G, #d);
expect(d.name, #d);
- expect(d.isProperty, isTrue);
+ expect(d.isField, isTrue);
+ expect(d.isProperty, isFalse);
expect(d.isMethod, isFalse);
expect(d.isFinal, isFalse);
expect(d.isStatic, isFalse);
@@ -200,18 +206,37 @@ main() {
expect(res.map((e) => e.name), [#i, #j, #j2]);
});
+ test('only fields', () {
+ var options = new smoke.QueryOptions(includeProperties: false);
+ var res = smoke.query(A, options);
+ expect(res.map((e) => e.name), [#i, #j]);
+ });
+
+ test('only properties', () {
+ var options = new smoke.QueryOptions(includeFields: false);
+ var res = smoke.query(A, options);
+ expect(res.map((e) => e.name), [#j2]);
+ });
+
test('properties and methods', () {
var options = new smoke.QueryOptions(includeMethods: true);
var res = smoke.query(A, options);
expect(res.map((e) => e.name), [#i, #j, #j2, #inc0, #inc1, #inc2]);
});
- test('inherited properties', () {
+ test('inherited properties and fields', () {
var options = new smoke.QueryOptions(includeInherited: true);
var res = smoke.query(D, options);
expect(res.map((e) => e.name), [#x, #y, #b, #i, #j, #j2, #x2, #i2]);
});
+ test('inherited fields only', () {
+ var options = new smoke.QueryOptions(includeInherited: true,
+ includeProperties: false);
+ var res = smoke.query(D, options);
+ expect(res.map((e) => e.name), [#x, #y, #b, #i, #j]);
+ });
+
test('exact annotation', () {
var options = new smoke.QueryOptions(includeInherited: true,
withAnnotations: const [a1]);
« no previous file with comments | « pkg/smoke/lib/static.dart ('k') | pkg/smoke/test/static_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698