Files
sdk/pkg/analyzer/test/src/diagnostics/assignment_to_function_test.dart
T
Konstantin Shcheglov 245105300c CQ. Migrate diagnostics tests to resolveTestCodeWithDiagnostics. A-B.
Change-Id: I260150562d253f480f70f04b7038fc7bcdadca26
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/501764
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2026-05-12 13:16:41 -07:00

29 lines
830 B
Dart

// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:test_reflective_loader/test_reflective_loader.dart';
import '../dart/resolution/context_collection_resolution.dart';
import '../dart/resolution/node_text_expectations.dart';
main() {
defineReflectiveSuite(() {
defineReflectiveTests(AssignmentToFunctionTest);
defineReflectiveTests(UpdateNodeTextExpectations);
});
}
@reflectiveTest
class AssignmentToFunctionTest extends PubPackageResolutionTest {
test_function() async {
await resolveTestCodeWithDiagnostics(r'''
f() {}
main() {
f = null;
//^
// [diag.assignmentToFunction] Functions can't be assigned a value.
}''');
}
}