diff --git a/analyzer_plugin/lib/src/angular_driver.dart b/analyzer_plugin/lib/src/angular_driver.dart index 971b211d..6d95f91f 100644 --- a/analyzer_plugin/lib/src/angular_driver.dart +++ b/analyzer_plugin/lib/src/angular_driver.dart @@ -25,7 +25,6 @@ import 'package:angular_analyzer_plugin/src/summary/idl.dart'; import 'package:angular_analyzer_plugin/src/summary/format.dart'; import 'package:angular_analyzer_plugin/src/standard_components.dart'; import 'package:analyzer/src/generated/engine.dart'; -import 'package:tuple/tuple.dart'; import 'package:analyzer/src/dart/analysis/file_state.dart'; import 'package:crypto/crypto.dart'; diff --git a/analyzer_plugin/lib/starter.dart b/analyzer_plugin/lib/starter.dart index d39e131e..dff6cfef 100644 --- a/analyzer_plugin/lib/starter.dart +++ b/analyzer_plugin/lib/starter.dart @@ -1,3 +1,6 @@ +import 'dart:async'; + +import 'package:analyzer/error/error.dart'; import 'package:analysis_server/src/analysis_server.dart'; import 'package:analyzer/src/generated/source.dart'; import 'package:angular_analyzer_plugin/src/angular_driver.dart'; @@ -64,6 +67,6 @@ class Starter { } } - send(null, null, null); + sendFn(null, null, null); } } diff --git a/analyzer_plugin/test/angular_driver_test.dart b/analyzer_plugin/test/angular_driver_test.dart index 97cee82e..85e955e8 100644 --- a/analyzer_plugin/test/angular_driver_test.dart +++ b/analyzer_plugin/test/angular_driver_test.dart @@ -22,14 +22,15 @@ import 'package:unittest/unittest.dart'; import 'abstract_angular.dart'; main() { - groupSep = ' | '; - defineReflectiveTests(AngularParseHtmlTest); - defineReflectiveTests(BuildStandardHtmlComponentsTest); - defineReflectiveTests(BuildUnitDirectivesTest); - defineReflectiveTests(BuildUnitViewsTest); - defineReflectiveTests(ResolveDartTemplatesTest); - defineReflectiveTests(ResolveHtmlTemplatesTest); - defineReflectiveTests(ResolveHtmlTemplateTest); + defineReflectiveSuite(() { + defineReflectiveTests(AngularParseHtmlTest); + defineReflectiveTests(BuildStandardHtmlComponentsTest); + defineReflectiveTests(BuildUnitDirectivesTest); + defineReflectiveTests(BuildUnitViewsTest); + defineReflectiveTests(ResolveDartTemplatesTest); + defineReflectiveTests(ResolveHtmlTemplatesTest); + defineReflectiveTests(ResolveHtmlTemplateTest); + }); } @reflectiveTest @@ -261,7 +262,7 @@ class BuildUnitDirectivesTest extends AbstractAngularTest { } Future test_Component() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -309,7 +310,7 @@ class ComponentB { } Future test_Directive() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -357,7 +358,7 @@ class DirectiveB { } Future test_Directive_elementTags_OrSelector() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -414,7 +415,7 @@ class DirectiveB { } Future test_Directive_elementTags_AndSelector() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -462,7 +463,7 @@ class DirectiveB { } Future test_Directive_elementTags_CompoundSelector() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -527,7 +528,7 @@ class ComponentA { class ComponentB { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); expect(directives, hasLength(2)); { @@ -561,7 +562,7 @@ class DirectiveA { class DirectiveB { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); expect(directives, hasLength(2)); { @@ -584,7 +585,7 @@ class DirectiveB { } Future test_exportAs_hasError_notStringValue() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -603,7 +604,7 @@ class ComponentA { } Future test_exportAs_constantStringExpressionOk() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -619,7 +620,7 @@ class ComponentA { } Future test_hasError_ArgumentSelectorMissing() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -641,7 +642,7 @@ import '/angular2/angular2.dart'; class ComponentA { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); // validate assertErrorInCodeAtPosition( @@ -649,7 +650,7 @@ class ComponentA { } Future test_hasError_selector_notStringValue() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -667,7 +668,7 @@ class ComponentA { } Future test_selector_constantExpressionOk() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -682,7 +683,7 @@ class ComponentA { } Future test_hasError_UndefinedSetter_fullSyntax() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -702,7 +703,7 @@ class ComponentA { } Future test_hasError_UndefinedSetter_shortSyntax() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -718,7 +719,7 @@ class ComponentA { } Future test_hasError_UndefinedSetter_shortSyntax_noInputMade() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -756,7 +757,7 @@ class MyComponent { set someSetter(String x) { } } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component component = directives.single; List inputs = component.inputs; @@ -835,7 +836,7 @@ class MyComponent { String trailingText; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component component = directives.single; List inputs = component.inputs; @@ -881,7 +882,7 @@ class MyComponent { EventEmitter get someGetter => null; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component component = directives.single; List compOutputs = component.outputs; @@ -965,7 +966,7 @@ class MyComponent { Stream myOutput; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component component = directives.single; List compOutputs = component.outputs; @@ -992,7 +993,7 @@ class MyComponent { MyStream myOutput; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component component = directives.single; List compOutputs = component.outputs; @@ -1019,7 +1020,7 @@ class MyComponent { MyStream myOutput; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component component = directives.single; List compOutputs = component.outputs; @@ -1046,7 +1047,7 @@ class MyComponent { MyStream myOutput; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component component = directives.single; List compOutputs = component.outputs; @@ -1070,7 +1071,7 @@ class MyComponent { int badOutput; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); assertErrorInCodeAtPosition( AngularWarningCode.OUTPUT_MUST_BE_EVENTEMITTER, code, "badOutput"); @@ -1088,7 +1089,7 @@ class MyComponent { int badOutput; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); // validate Component component = directives.single; @@ -1120,7 +1121,7 @@ class MyComponent { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); // validate Component component = directives.single; @@ -1199,7 +1200,7 @@ class Generic { class MyComponent extends Generic { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component component = directives.single; List compInputs = component.inputs; @@ -1238,7 +1239,7 @@ class Generic { class MyComponent extends Generic { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component component = directives.single; List compInputs = component.inputs; @@ -1269,7 +1270,7 @@ class MyComponent { @Input() final int immutable = 1; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); // validate assertErrorInCodeAtPosition( @@ -1287,7 +1288,7 @@ class MyComponent { final int immutable = 1; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); // validate. Can't easily assert position though because its all 'immutable' errorListener @@ -1295,7 +1296,7 @@ class MyComponent { } Future test_noDirectives() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' class A {} @@ -1315,7 +1316,7 @@ class MyComponent { String get someGetter => null; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); assertErrorInCodeAtPosition( AngularWarningCode.INPUT_ANNOTATION_PLACEMENT_INVALID, @@ -1333,7 +1334,7 @@ class MyComponent { set someSetter(x) { } } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); assertErrorInCodeAtPosition( AngularWarningCode.OUTPUT_ANNOTATION_PLACEMENT_INVALID, @@ -1380,7 +1381,7 @@ import '/angular2/angular2.dart'; directives: const [NgFor]) class OtherComponent {} '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); newSource('/other_file.dart', otherCode); await getViews(source); { @@ -1419,7 +1420,7 @@ const DIR_AB = const [DirectiveA, DirectiveB]; directives: const [DIR_AB, DirectiveC]) class MyComponent {} '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getViews(source); { View view = getViewByClassName(views, 'MyComponent'); @@ -1460,7 +1461,7 @@ import 'other.dart' as other; directives: const [other.DIR_AB, other.DirectiveC]) class MyComponent {} '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); newSource('/other.dart', otherCode); await getViews(source); { @@ -1488,14 +1489,14 @@ const NOT_DIRECTIVE_LIST = 42; directives: const [NOT_DIRECTIVE_LIST]) class MyComponent {} '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getViews(source); errorListener.assertErrorsWithCodes( [AngularWarningCode.TYPE_IS_NOT_A_DIRECTIVE]); } Future test_hasError_ComponentAnnotationMissing() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -1510,7 +1511,7 @@ class ComponentA { } Future test_hasError_StringValueExpected() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -1527,7 +1528,7 @@ class ComponentA { } Future test_constantExpressionTemplateOk() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -1541,7 +1542,7 @@ class ComponentA { } Future test_constantExpressionTemplateComplexIsOnlyError() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -1558,7 +1559,7 @@ class ComponentA { } Future test_hasError_TypeLiteralExpected() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -1573,7 +1574,7 @@ class ComponentA { } Future test_hasError_TemplateAndTemplateUrlDefined() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -1589,7 +1590,7 @@ class ComponentA { } Future test_hasError_NeitherTemplateNorTemplateUrlDefined() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -1610,7 +1611,7 @@ import '/angular2/angular2.dart'; @Component(selector: 'my-component', templateUrl: 'missing-template.html') class MyComponent {} '''; - Source dartSource = newSource('/test.dart', code); + var dartSource = newSource('/test.dart', code); await getViews(dartSource); assertErrorInCodeAtPosition( AngularWarningCode.REFERENCED_HTML_FILE_DOESNT_EXIST, @@ -1625,8 +1626,8 @@ import '/angular2/angular2.dart'; @Component(selector: 'my-component', templateUrl: 'my-template.html') class MyComponent {} '''; - Source dartSource = newSource('/test.dart', code); - Source htmlSource = newSource('/my-template.html', ''); + var dartSource = newSource('/test.dart', code); + var htmlSource = newSource('/my-template.html', ''); await getViews(dartSource); expect(views, hasLength(1)); // MyComponent @@ -1651,8 +1652,8 @@ import '/angular2/angular2.dart'; @View(templateUrl: 'my-template.html') class MyComponent {} '''; - Source dartSource = newSource('/test.dart', code); - Source htmlSource = newSource('/my-template.html', ''); + var dartSource = newSource('/test.dart', code); + var htmlSource = newSource('/my-template.html', ''); await getViews(dartSource); expect(views, hasLength(1)); // MyComponent @@ -1683,7 +1684,7 @@ class OtherComponent {} directives: const [MyDirective, OtherComponent]) class MyComponent {} '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getViews(source); expect(views, hasLength(2)); { @@ -1720,7 +1721,7 @@ class OtherComponent {} @View(template: 'My template', directives: const [MyDirective, OtherComponent]) class MyComponent {} '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getViews(source); expect(views, hasLength(2)); { @@ -1763,7 +1764,7 @@ class ResolveDartTemplatesTest extends AbstractAngularTest { } Future test_hasError_DirectiveTypeLiteralExpected() async { - Source source = newSource( + var source = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -1798,7 +1799,7 @@ class ComponentB { class ComponentC { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component componentA = getComponentByClassName(directives, 'ComponentA'); Component componentB = getComponentByClassName(directives, 'ComponentB'); @@ -1851,7 +1852,7 @@ class TextPanel { String text; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); errorListener.assertErrorsWithCodes( [StaticWarningCode.ARGUMENT_TYPE_NOT_ASSIGNABLE]); @@ -1875,7 +1876,7 @@ class TextPanel { class UserPanel { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); errorListener .assertErrorsWithCodes([StaticWarningCode.UNDEFINED_IDENTIFIER]); @@ -1891,7 +1892,7 @@ class MyComponent { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); assertErrorInCodeAtPosition( StaticWarningCode.UNDEFINED_IDENTIFIER, code, 'noSuchName'); @@ -1906,7 +1907,7 @@ import '/angular2/angular2.dart'; class ComponentA { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); assertErrorInCodeAtPosition( AngularWarningCode.UNRESOLVED_TAG, code, 'unresolved-tag'); @@ -1923,7 +1924,7 @@ import '/angular2/angular2.dart'; class ComponentA { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); errorListener.assertNoErrors(); } @@ -1939,7 +1940,7 @@ import '/angular2/angular2.dart'; class ComponentA { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); errorListener.assertNoErrors(); } @@ -1956,7 +1957,7 @@ class ComponentA { Object value; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); errorListener.assertNoErrors(); } @@ -1970,7 +1971,7 @@ import '/angular2/angular2.dart'; class TextPanel { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); // has errors errorListener.assertErrorsWithCodes([HtmlErrorCode.PARSE_ERROR]); @@ -1990,7 +1991,7 @@ class TodoList { gotClicked(MouseEvent event) {} } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); expect(templates, hasLength(1)); { @@ -2049,7 +2050,7 @@ class User { String name; // 2 } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component textPanel = getComponentByClassName(directives, 'TextPanel'); // validate @@ -2108,7 +2109,7 @@ class ComponentA { class ComponentB { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component componentA = getComponentByClassName(directives, 'ComponentA'); // validate @@ -2143,7 +2144,7 @@ import '/angular2/angular2.dart'; class TextPanel { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); expect(templates, hasLength(1)); // has errors @@ -2159,7 +2160,7 @@ import '/angular2/angular2.dart'; class TextPanel { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); expect(templates, hasLength(1)); // has errors @@ -2175,7 +2176,7 @@ class TextPanel { String text = "text"; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); // has errors errorListener @@ -2190,7 +2191,7 @@ import '/angular2/angular2.dart'; class TextPanel { } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); // has errors errorListener.assertErrorsWithCodes([AngularWarningCode.UNOPENED_MUSTACHE]); @@ -2205,7 +2206,7 @@ class TextPanel { String text; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); errorListener.assertErrorsWithCodes([ AngularWarningCode.UNTERMINATED_MUSTACHE, @@ -2222,7 +2223,7 @@ class TextPanel { String text, open, close; } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); errorListener.assertErrorsWithCodes([ AngularWarningCode.UNTERMINATED_MUSTACHE, @@ -2243,7 +2244,7 @@ class TextPanel { String text; // 1 } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); expect(templates, hasLength(1)); { @@ -2295,7 +2296,7 @@ import '/angular2/angular2.dart'; directives: const []) class ChildComponent {} '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); newSource('/child_file.dart', childCode); await getDirectives(source); expect(templates, hasLength(1)); @@ -2324,7 +2325,7 @@ class MyComponent { MyComponent(@Attribute("my-attr") String foo); } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component component = directives.single; List attributes = component.attributes; @@ -2348,7 +2349,7 @@ class MyComponent { MyComponent(@Attribute("my-attr") int foo); } '''; - Source source = newSource('/test.dart', code); + var source = newSource('/test.dart', code); await getDirectives(source); Component component = directives.single; List attributes = component.attributes; @@ -2412,9 +2413,9 @@ class TextPanelB { {{text}} """; - Source dartSourceOne = newSource('/test1.dart', dartCodeOne); - Source dartSourceTwo = newSource('/test2.dart', dartCodeTwo); - Source htmlSource = newSource('/text_panel.html', htmlCode); + var dartSourceOne = newSource('/test1.dart', dartCodeOne); + var dartSourceTwo = newSource('/test2.dart', dartCodeTwo); + var htmlSource = newSource('/text_panel.html', htmlCode); await getDirectives(htmlSource, [dartSourceOne, dartSourceTwo]); expect(templates, hasLength(2)); // validate templates @@ -2459,7 +2460,7 @@ class ResolveHtmlTemplateTest extends AbstractAngularTest { } Future test_suppressError_UnresolvedTagHtmlTemplate() async { - Source dartSource = newSource( + var dartSource = newSource( '/test.dart', r''' import '/angular2/angular2.dart'; @@ -2468,7 +2469,7 @@ import '/angular2/angular2.dart'; class ComponentA { } '''); - Source htmlSource = newSource( + var htmlSource = newSource( '/test.html', ''' @@ -2486,8 +2487,8 @@ import '/angular2/angular2.dart'; class ComponentA { } '''; - Source dartSource = newSource('/weird.dart', code); - Soruce htmlSource = + var dartSource = newSource('/weird.dart', code); + var htmlSource = newSource('/test.html', ""); await getDirectives(htmlSource, dartSource); final errors = errorListener.errors; @@ -2511,8 +2512,8 @@ class TextPanel { {{text}} """; - Source dartSource = newSource('/test.dart', dartCode); - Source htmlSource = newSource('/text_panel.html', htmlCode); + var dartSource = newSource('/test.dart', dartCode); + var htmlSource = newSource('/text_panel.html', htmlCode); // compute await getDirectives(htmlSource, dartSource); expect(views, hasLength(1)); @@ -2551,9 +2552,9 @@ import '/angular2/angular2.dart'; directives: const []) class ChildComponent {} '''; - Source dartSource = newSource('/test.dart', code); + var dartSource = newSource('/test.dart', code); newSource('/child_file.dart', childCode); - Source htmlSource = newSource('/test.html', ''); + var htmlSource = newSource('/test.html', ''); await getDirectives(htmlSource, dartSource); List childDirectives = views.first.directives; diff --git a/analyzer_plugin/test/file_tracker_test.dart b/analyzer_plugin/test/file_tracker_test.dart index 7e7b69d6..2ea28f6d 100644 --- a/analyzer_plugin/test/file_tracker_test.dart +++ b/analyzer_plugin/test/file_tracker_test.dart @@ -5,8 +5,9 @@ import 'package:unittest/unittest.dart'; import 'package:typed_mock/typed_mock.dart'; main() { - groupSep = ' | '; - defineReflectiveTests(FileTrackerTest); + defineReflectiveSuite(() { + defineReflectiveTests(FileTrackerTest); + }); } @reflectiveTest diff --git a/analyzer_plugin/test/fuzz_test.dart b/analyzer_plugin/test/fuzz_test.dart index a84553d3..af1a9e86 100644 --- a/analyzer_plugin/test/fuzz_test.dart +++ b/analyzer_plugin/test/fuzz_test.dart @@ -9,8 +9,9 @@ import 'package:test_reflective_loader/test_reflective_loader.dart'; import 'abstract_angular.dart'; main() { - groupSep = ' | '; - defineReflectiveTests(FuzzTest); + defineReflectiveSuite(() { + defineReflectiveTests(FuzzTest); + }); } @reflectiveTest @@ -589,7 +590,7 @@ class CounterComponent { if (directive is Component && directive.view?.templateUriSource?.fullName == '/test.html') { try { - await angularDriver.resolveHtml('/test.html', '/test.dart'); + await angularDriver.resolveHtml('/test.html'); } catch (e, stacktrace) { print("ResolveHtml failed\n$reason\n$e\n$stacktrace"); } diff --git a/analyzer_plugin/test/offsetting_constant_value_visitor_test.dart b/analyzer_plugin/test/offsetting_constant_value_visitor_test.dart index 40c73b8b..a143b0d8 100644 --- a/analyzer_plugin/test/offsetting_constant_value_visitor_test.dart +++ b/analyzer_plugin/test/offsetting_constant_value_visitor_test.dart @@ -9,8 +9,9 @@ import 'package:test_reflective_loader/test_reflective_loader.dart'; import 'package:unittest/unittest.dart'; main() { - groupSep = ' | '; - defineReflectiveTests(OffsettingConstantValueVisitorTest); + defineReflectiveSuite(() { + defineReflectiveTests(OffsettingConstantValueVisitorTest); + }); } @reflectiveTest diff --git a/analyzer_plugin/test/resolver_test.dart b/analyzer_plugin/test/resolver_test.dart index e5f4df04..7aace9f3 100644 --- a/analyzer_plugin/test/resolver_test.dart +++ b/analyzer_plugin/test/resolver_test.dart @@ -16,8 +16,9 @@ import 'abstract_angular.dart'; import 'element_assert.dart'; main() { - groupSep = ' | '; - defineReflectiveTests(TemplateResolverTest); + defineReflectiveSuite(() { + defineReflectiveTests(TemplateResolverTest); + }); } void assertPropertyElement(AngularElement element, diff --git a/analyzer_plugin/test/selector_test.dart b/analyzer_plugin/test/selector_test.dart index d5a1b140..f92b54b5 100644 --- a/analyzer_plugin/test/selector_test.dart +++ b/analyzer_plugin/test/selector_test.dart @@ -8,17 +8,18 @@ import 'package:typed_mock/typed_mock.dart'; import 'package:unittest/unittest.dart'; main() { - groupSep = ' | '; - defineReflectiveTests(AndSelectorTest); - defineReflectiveTests(AttributeSelectorTest); - defineReflectiveTests(ClassSelectorTest); - defineReflectiveTests(ElementNameSelectorTest); - defineReflectiveTests(OrSelectorTest); - defineReflectiveTests(NotSelectorTest); - defineReflectiveTests(AttributeValueRegexSelectorTest); - defineReflectiveTests(SelectorParserTest); - defineReflectiveTests(SuggestTagsTest); - defineReflectiveTests(HtmlTagForSelectorTest); + defineReflectiveSuite(() { + defineReflectiveTests(AndSelectorTest); + defineReflectiveTests(AttributeSelectorTest); + defineReflectiveTests(ClassSelectorTest); + defineReflectiveTests(ElementNameSelectorTest); + defineReflectiveTests(OrSelectorTest); + defineReflectiveTests(NotSelectorTest); + defineReflectiveTests(AttributeValueRegexSelectorTest); + defineReflectiveTests(SelectorParserTest); + defineReflectiveTests(SuggestTagsTest); + defineReflectiveTests(HtmlTagForSelectorTest); + }); } @reflectiveTest diff --git a/analyzer_plugin/test/test_all.dart b/analyzer_plugin/test/test_all.dart index 9dbb0440..c935c51c 100644 --- a/analyzer_plugin/test/test_all.dart +++ b/analyzer_plugin/test/test_all.dart @@ -1,6 +1,6 @@ library angular2.src.analysis.analyzer_plugin.src; -import 'package:unittest/unittest.dart'; +import 'package:test_reflective_loader/test_reflective_loader.dart'; import 'resolver_test.dart' as resolver_test; import 'selector_test.dart' as selector_test; @@ -12,11 +12,10 @@ import 'offsetting_constant_value_visitor_test.dart' * Utility for manually running all tests. */ main() { - groupSep = ' | '; - group('Angular Analyzer Plugin tests', () { + defineReflectiveSuite(() { resolver_test.main(); selector_test.main(); angular_driver_test.main(); offsetting_constant_value_visitor_test.main(); - }); + }, name: 'Angular Analyzer Plugin tests'); } diff --git a/deps/pubspec.yaml b/deps/pubspec.yaml index cde74673..b8e95435 100644 --- a/deps/pubspec.yaml +++ b/deps/pubspec.yaml @@ -4,6 +4,6 @@ description: What we need that the sdk doesn't provide dependencies: tuple: '^1.0.1' dev_dependencies: - test_reflective_loader: '^0.0.3' + test_reflective_loader: '^0.1.0' typed_mock: '^0.0.4' unittest: '^0.11.0' diff --git a/server_plugin/test/analysis_test.dart b/server_plugin/test/analysis_test.dart index 39c2c8d6..ef16d770 100644 --- a/server_plugin/test/analysis_test.dart +++ b/server_plugin/test/analysis_test.dart @@ -25,10 +25,12 @@ import 'package:unittest/unittest.dart'; import 'mock_sdk.dart'; main() { - groupSep = ' | '; - //defineReflectiveTests(AngularNavigationContributorTest); - //defineReflectiveTests(AngularOccurrencesContributorTest); - defineReflectiveTests(EmptyTest); + defineReflectiveSuite(() { + // TODO get these working again in the latest SDK + //defineReflectiveTests(AngularNavigationContributorTest); + //defineReflectiveTests(AngularOccurrencesContributorTest); + defineReflectiveTests(EmptyTest); + }); } @reflectiveTest diff --git a/server_plugin/test/completion_contributor_test.dart b/server_plugin/test/completion_contributor_test.dart index 1729a67d..612049da 100644 --- a/server_plugin/test/completion_contributor_test.dart +++ b/server_plugin/test/completion_contributor_test.dart @@ -7,7 +7,7 @@ import 'package:test_reflective_loader/test_reflective_loader.dart'; import 'completion_contributor_test_util.dart'; main() { - groupSep = ' | '; + // TODO: get these working again on the latest SDK //defineReflectiveTests(DartCompletionContributorTest); //defineReflectiveTests(HtmlCompletionContributorTest); } diff --git a/server_plugin/test/test_all.dart b/server_plugin/test/test_all.dart index 1397c86e..ad9b4fe7 100644 --- a/server_plugin/test/test_all.dart +++ b/server_plugin/test/test_all.dart @@ -1,6 +1,6 @@ library angular2.src.analysis.analyzer_plugin.src; -import 'package:unittest/unittest.dart'; +import 'package:test_reflective_loader/test_reflective_loader.dart'; import 'analysis_test.dart' as analysis_test; import 'completion_contributor_test.dart' as completion_contributor_test; @@ -9,9 +9,8 @@ import 'completion_contributor_test.dart' as completion_contributor_test; * Utility for manually running all tests. */ main() { - groupSep = ' | '; - group('Angular Server Plugin tests', () { + defineReflectiveSuite(() { analysis_test.main(); completion_contributor_test.main(); - }); + }, name: 'Angular Server Plugin tests'); } diff --git a/tools/update_deps.sh b/tools/update_deps.sh index 2e3b7c35..b1195fe7 100755 --- a/tools/update_deps.sh +++ b/tools/update_deps.sh @@ -12,7 +12,7 @@ echo cd .. echo Copying and transforming sdk .packages to be useful to this repo -cat deps/sdk/.packages | grep -v '^test' | grep -v '^typed_mock' | grep -v '^unittest' | sed 's/:/:deps\/sdk\//' > .packages +cat deps/sdk/.packages | grep -v '^typed_mock' | grep -v '^unittest' | grep -v '^test_reflective_loader' | sed 's/:/:deps\/sdk\//' > .packages echo done echo