Skip to content

TestSemantics typo bugs #185900

Description

@justinmc

There are several blatant bugs in TestSemantics that we should fix:

1. Comparison of locales

This line in TestSemantics is useless; it compares a value to itself:

(second[i] as LocaleStringAttribute).locale !=
(second[i] as LocaleStringAttribute).locale)) {

Instead, it should compare with (first[i] as LocaleStringAttribute).locale.

2. Comparison of controlNodes

Another instance of comparing something to itself:

if (controlsNodes != controlsNodes && !setEquals(controlsNodes, node.controlsNodes)) {

3. Random comma in an assert

This comma appears to be a typo. It puts part of the logic into the error message field 🤔 .

inputType != null,
minValue != null || maxValue != null,
);

These bugs may exist in several places. For example, PR #185736 is copying TestSemantics into the Material library. We should search for all instances of TestSemantics and fix it everywhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: tests"flutter test", flutter_test, or one of our teststeam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions