Skip to content

Restructure analyzer test cases to be null safe by default #44666

Closed
@srawlins

Description

@srawlins

I don't know if anyone has vigorously updated our test files to include both a pre-null-safety and a post-null-safety class, even if there are no new or deprecated test cases for the new class. For example, non_constant_case_expression_test.dart contains:

main() {
  defineReflectiveSuite(() {
    defineReflectiveTests(NonConstantCaseExpressionTest);
    defineReflectiveTests(NonConstantCaseExpressionWithNullSafetyTest);
  });
}

@reflectiveTest
class NonConstantCaseExpressionTest extends PubPackageResolutionTest {
  // Test cases
}

@reflectiveTest
class NonConstantCaseExpressionWithNullSafetyTest
    extends NonConstantCaseExpressionTest with WithNullSafetyMixin {}

I'm happy to grind through "all" of our test files (maybe all diagnostics/ tests and a few other directories?) and add null safety sibling test classes.

In addition, maybe I'll take the step of defaulting to null safety (since it is the default language version now), and write classes like FooTest and FooWithoutNullSafetyTest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    NNBDIssues related to NNBD ReleaseP2A bug or feature request we're likely to work onanalyzer-technical-debtlegacy-area-analyzerUse area-devexp instead.type-taskA well-defined stand-alone task

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions