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

Unified Diff: pkg/smoke/test/codegen/recorder_test.dart

Issue 306993002: smoke: support named argument in annotations (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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/test/codegen/end_to_end_test.dart ('k') | pkg/smoke/test/common.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/smoke/test/codegen/recorder_test.dart
diff --git a/pkg/smoke/test/codegen/recorder_test.dart b/pkg/smoke/test/codegen/recorder_test.dart
index 091abac3f85458a87cead3bc9baf4de2efaef4bc..14f8d81bf7cb87be2f359f6e8da19efd20485542 100644
--- a/pkg/smoke/test/codegen/recorder_test.dart
+++ b/pkg/smoke/test/codegen/recorder_test.dart
@@ -67,7 +67,7 @@ main() {
imports: [
"import '/a.dart' as smoke_0;",
],
- topLevel:
+ topLevel:
'abstract class _M0 {} // A & D1\n'
'abstract class _M1 {} // _M0 & D2\n'
'abstract class _M2 {} // _M1 & D3\n',
@@ -573,6 +573,28 @@ main() {
' },\n'
' }));\n');
});
+
+ test('type annotation with named arguments', () {
+ var lib = provider.libraryFor('/common.dart');
+ var options = new QueryOptions(includeInherited: true,
+ withAnnotations: [lib.getType('AnnotC')]);
+ recorder.runQuery(lib.getType('K'), options, includeAccessors: false);
+ final kAnnot = 'annotations: const [const smoke_0.AnnotC(named: true)]';
+ final k2Annot = 'annotations: const [const smoke_0.AnnotC()]';
+ checkResults(generator,
+ imports: [
+ "import '/common.dart' as smoke_0;",
+ ],
+ initCall:
+ 'useGeneratedCode(new StaticConfiguration(\n'
+ ' checkedMode: false,\n'
+ ' declarations: {\n'
+ ' smoke_0.K: {\n'
+ ' #k: const Declaration(#k, int, $kAnnot),\n'
+ ' #k2: const Declaration(#k2, int, $k2Annot),\n'
+ ' },\n'
+ ' }));\n');
+ });
});
group('with accessors', () {
@@ -801,6 +823,7 @@ const _SOURCES = const {
class Annot { const Annot(int ignore); }
class AnnotB extends Annot { const AnnotB(); }
+ class AnnotC { const AnnotC({bool named: false}); }
const a1 = const Annot(0);
const a2 = 32;
const a3 = const AnnotB();
@@ -837,6 +860,11 @@ const _SOURCES = const {
}
class J3 extends J2 {
}
+
+ class K {
+ @AnnotC(named: true) int k;
+ @AnnotC() int k2;
+ }
'''
};
« no previous file with comments | « pkg/smoke/test/codegen/end_to_end_test.dart ('k') | pkg/smoke/test/common.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698