tree: 6aa1e14672e03a0265b1326f2994458bf194ed86 [path history] [tgz]
  1. impl/
  2. class_declarations_macro_test.dart
  3. class_definition_macro_test.dart
  4. class_types_macro_test.dart
  5. README.md
tests/language/macros/augment/README.md

Macro “Augment” Tests

These tests (will) cover the “write” half of the macro API, the augmentation of code of every supported type in every supported place.

See: package:_fe_analyzer_shared/lib/src/macros/api/macros.dart

For every macro interface, a file impl/<macro_interface_name>.dart defines one macro for each augmentation method on that macro interface's builder type. Arguments to the macro match that builder method, and are passed through.

For example, for ClassDeclarationsMacro#declareInType, the macro ClassDeclarationsDeclareInType is defined in impl/class_declarations_macro.dart.

Identifier arguments are passed as String, and will be resolved in the current library. Code arguments are also passed as String, in these strings Identifiers to resolve must be enclosed in backticks. They will be resolved in dart:core so that you can refer to, for example, int.

The tests are likewise named by the macro interface they test, for example class_declarations_macro_test.dart.