Chromium Code Reviews| Index: pkg/analyzer/test/generated/hint_code_test.dart |
| diff --git a/pkg/analyzer/test/generated/hint_code_test.dart b/pkg/analyzer/test/generated/hint_code_test.dart |
| index 52b0febf25bf92c570fbce05e5e66a5dc5004015..d046870e02c53eed5b42310fd5bda25de398e81b 100644 |
| --- a/pkg/analyzer/test/generated/hint_code_test.dart |
| +++ b/pkg/analyzer/test/generated/hint_code_test.dart |
| @@ -944,6 +944,78 @@ class B extends A { |
| verify([source]); |
| } |
| + test_deprecatedFunction_class() async { |
| + Source source = addSource(r''' |
| +class Function {} |
| +'''); |
| + await computeAnalysisResult(source); |
| + assertErrors(source, [HintCode.DEPRECATED_FUNCTION_CLASS_DECLARATION]); |
| + verify([source]); |
| + } |
| + |
| + test_deprecatedFunction_extends() async { |
| + Source source = addSource(r''' |
| +class A extends Function {} |
| +'''); |
| + await computeAnalysisResult(source); |
| + assertErrors(source, [ |
| + HintCode.DEPRECATED_EXTENDS_FUNCTION, |
| + StaticWarningCode.FUNCTION_WITHOUT_CALL |
| + ]); |
| + verify([source]); |
| + } |
| + |
| + test_deprecatedFunction_extends2() async { |
| + Source source = addSource(r''' |
| +class Function {} |
| +class A extends Function {} |
| +'''); |
| + await computeAnalysisResult(source); |
| + assertErrors(source, [ |
| + HintCode.DEPRECATED_FUNCTION_CLASS_DECLARATION, |
| + HintCode.DEPRECATED_EXTENDS_FUNCTION |
| + ]); |
| + verify([source]); |
| + } |
| + |
| + test_deprecatedFunction_implements() async { |
| + Source source = addSource(r''' |
| +class A implements Function {} |
| +'''); |
| + await computeAnalysisResult(source); |
| + assertErrors(source, [ |
| + HintCode.DEPRECATED_IMPLEMENTS_FUNCTION, |
| + StaticWarningCode.FUNCTION_WITHOUT_CALL |
| + ]); |
| + verify([source]); |
| + } |
| + |
| + test_deprecatedFunction_implements2() async { |
| + Source source = addSource(r''' |
| +class Function {} |
| +class A implements Function {} |
| +'''); |
| + await computeAnalysisResult(source); |
| + assertErrors(source, [ |
| + HintCode.DEPRECATED_FUNCTION_CLASS_DECLARATION, |
| + HintCode.DEPRECATED_IMPLEMENTS_FUNCTION |
| + ]); |
| + verify([source]); |
| + } |
| + |
| + test_deprecatedFunction_mixin() async { |
|
Brian Wilkerson
2017/01/19 18:16:05
Perhaps split this into two tests (one with and on
floitsch
2017/01/19 18:22:49
Done.
|
| + Source source = addSource(r''' |
| +class Function {} |
| +class A extends Object with Function {} |
| +'''); |
| + await computeAnalysisResult(source); |
| + assertErrors(source, [ |
| + HintCode.DEPRECATED_FUNCTION_CLASS_DECLARATION, |
| + HintCode.DEPRECATED_MIXIN_FUNCTION |
| + ]); |
| + verify([source]); |
| + } |
| + |
| test_divisionOptimization_double() async { |
| Source source = addSource(r''' |
| f(double x, double y) { |