Skip to content

Add full-output transpile tests for classes inside #if blocks #1900

Open

Description

@TwitchBronBron

Follow-up from a review comment on #1886: #1886 (comment)

A class transpiles to several functions: __Foo_builder, one __Foo_method_* per method, and the function Foo() factory. When the class is inside an #if / #else block, all of them must be emitted inside that same branch. Otherwise the device compiles a factory without its methods, or methods for a class it never declares.

The existing tests only check substrings of the output. Add full-output transpile tests (testTranspile) that cover:

  • a class with methods inside #if DEBUG, with and without DEBUG declared
  • the same class name declared in both #if and #else with different members
  • a child class extending a parent, both inside the same #if
  • an active class and an inactive class in the same file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions