Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

update test #4084

Merged
merged 3 commits into from
Feb 22, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions test/rules/non_constant_identifier_names_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,25 @@ class NonConstantIdentifierNamesPatternsTest extends LintRuleTest {
@override
String get lintRule => 'non_constant_identifier_names';

@FailingTest(reason: 'Flow analysis fails w/ a Bad state exception')
test_patternForStatement() async {
await assertDiagnostics(r'''
void f() {
for (var (AB, ) = (0, 1); AB <= 13; (AB, ) = ( , AB++)) { }
for (var (AB, c) = (0, 1); AB <= 13; (AB, c) = (c, AB + c)) { }
}
''', [
lint(18, 2),
lint(23, 2),
]);
}

test_patternIfStatement() async {
await assertDiagnostics(r'''
void f() {
if ([1,2] case [int AB, int]) { }
if ([1,2] case [int AB, int c]) { }
}
''', [
error(WarningCode.UNUSED_LOCAL_VARIABLE, 33, 2),
lint(33, 2),
error(WarningCode.UNUSED_LOCAL_VARIABLE, 41, 1),
]);
}

Expand Down