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

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

Issue 194813007: Add codegen support in smoke (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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
Index: pkg/smoke/test/common.dart
diff --git a/pkg/smoke/test/common.dart b/pkg/smoke/test/common.dart
index d60679f56a7a114478a968524494ad68e83d0921..35d2248fa845363497bba8a3164466ec81e5ae23 100644
--- a/pkg/smoke/test/common.dart
+++ b/pkg/smoke/test/common.dart
@@ -215,72 +215,76 @@ main() {
});
group('query', () {
+ _checkQuery(result, names) {
+ expect(result.map((e) => e.name), unorderedEquals(names));
+ }
+
test('default', () {
var options = new smoke.QueryOptions();
var res = smoke.query(A, options);
- expect(res.map((e) => e.name), [#i, #j, #j2]);
+ _checkQuery(res, [#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]);
+ _checkQuery(res, [#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]);
+ _checkQuery(res, [#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]);
+ _checkQuery(res, [#i, #j, #j2, #inc0, #inc1, #inc2]);
});
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]);
+ _checkQuery(res, [#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]);
+ _checkQuery(res, [#x, #y, #b, #i, #j]);
});
test('exact annotation', () {
var options = new smoke.QueryOptions(includeInherited: true,
withAnnotations: const [a1]);
var res = smoke.query(H, options);
- expect(res.map((e) => e.name), [#b, #f, #g]);
+ _checkQuery(res, [#b, #f, #g]);
options = new smoke.QueryOptions(includeInherited: true,
withAnnotations: const [a2]);
res = smoke.query(H, options);
- expect(res.map((e) => e.name), [#d, #h]);
+ _checkQuery(res, [#d, #h]);
options = new smoke.QueryOptions(includeInherited: true,
withAnnotations: const [a1, a2]);
res = smoke.query(H, options);
- expect(res.map((e) => e.name), [#b, #d, #f, #g, #h]);
+ _checkQuery(res, [#b, #d, #f, #g, #h]);
});
test('type annotation', () {
var options = new smoke.QueryOptions(includeInherited: true,
withAnnotations: const [Annot]);
var res = smoke.query(H, options);
- expect(res.map((e) => e.name), [#b, #f, #g, #i]);
+ _checkQuery(res, [#b, #f, #g, #i]);
});
test('mixed annotations (type and exact)', () {
var options = new smoke.QueryOptions(includeInherited: true,
withAnnotations: const [a2, Annot]);
var res = smoke.query(H, options);
- expect(res.map((e) => e.name), [#b, #d, #f, #g, #h, #i]);
+ _checkQuery(res, [#b, #d, #f, #g, #h, #i]);
});
test('symbol to name', () {

Powered by Google App Engine
This is Rietveld 408576698