Augment. Rewrite AugmentationTypeParameterCountTest without parts.

Change-Id: I7f459a2f54301985aca42c068a11a7a82555ae05
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/453422
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
diff --git a/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_count_test.dart b/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_count_test.dart
index 9a93535..26c0a1e 100644
--- a/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_count_test.dart
+++ b/pkg/analyzer/test/src/diagnostics/augmentation_type_parameter_count_test.dart
@@ -17,475 +17,271 @@
 class AugmentationTypeParameterCountTest extends PubPackageResolutionTest {
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_class_0_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-class A {}
-''');
-
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+class A {}
 augment class A<T> {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 34, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 26, 1)],
     );
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_class_1_0() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-class A<T> {}
-''');
-
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+class A<T> {}
 augment class A {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 33, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 29, 1)],
     );
   }
 
   test_class_1_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-class A<T> {}
-''');
-
     await assertNoErrorsInCode(r'''
-part of 'a.dart';
-
+class A<T> {}
 augment class A<T> {}
 ''');
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_class_1_2() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-class A<T> {}
-''');
-
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+class A<T> {}
 augment class A<T, U> {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 38, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 29, 1)],
     );
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_class_2_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
+    await assertErrorsInCode(
+      r'''
 class A<T, U> {}
-''');
-
-    await assertErrorsInCode(
-      r'''
-part of 'a.dart';
-
 augment class A<T> {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 36, 1)],
-    );
-  }
-
-  @SkippedTest() // TODO(scheglov): implement augmentation
-  test_class_method() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-class A {
-  void foo() {}
-}
-''');
-
-    await assertErrorsInCode(
-      r'''
-part of 'a.dart';
-
-augment class A<T> {
-  augment void foo() {}
-}
-''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 34, 1)],
-    );
-  }
-
-  @SkippedTest() // TODO(scheglov): implement augmentation
-  test_enum_0_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-enum A {v}
-''');
-
-    await assertErrorsInCode(
-      r'''
-part of 'a.dart';
-
-augment enum A<T> {}
-''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 33, 1)],
-    );
-  }
-
-  @SkippedTest() // TODO(scheglov): implement augmentation
-  test_enum_1_0() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-enum A<T> {v}
-''');
-
-    await assertErrorsInCode(
-      r'''
-part of 'a.dart';
-
-augment enum A {}
-''',
       [error(CompileTimeErrorCode.augmentationTypeParameterCount, 32, 1)],
     );
   }
 
-  test_enum_1_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
+  @SkippedTest() // TODO(scheglov): implement augmentation
+  test_enum_0_1() async {
+    await assertErrorsInCode(
+      r'''
+enum A {v}
+augment enum A<T> {}
+''',
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 25, 1)],
+    );
+  }
 
+  @SkippedTest() // TODO(scheglov): implement augmentation
+  test_enum_1_0() async {
+    await assertErrorsInCode(
+      r'''
 enum A<T> {v}
-''');
+augment enum A {}
+''',
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 28, 1)],
+    );
+  }
 
+  test_enum_1_1() async {
     await assertNoErrorsInCode(r'''
-part of 'a.dart';
-
+enum A<T> {v}
 augment enum A <T>{}
 ''');
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_enum_1_2() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-enum A<T> {v}
-''');
-
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+enum A<T> {v}
 augment enum A<T, U> {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 37, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 28, 1)],
     );
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_enum_2_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-enum A<T, U> {v}
-''');
-
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+enum A<T, U> {v}
 augment enum A<T> {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 35, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 31, 1)],
     );
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_extension_0_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-extension A on int {}
-''');
-
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+extension A on int {}
 augment extension A<T> {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 38, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 41, 1)],
     );
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_extension_1_0() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-extension A<T> on int {}
-''');
-
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+extension A<T> on int {}
 augment extension A {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 37, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 44, 1)],
     );
   }
 
   test_extension_1_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-extension A<T> on int {}
-''');
-
     await assertNoErrorsInCode(r'''
-part of 'a.dart';
-
+extension A<T> on int {}
 augment extension A<T> {}
 ''');
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_extension_1_2() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-extension A<T> on int {}
-''');
-
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+extension A<T> on int {}
 augment extension A<T, U> {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 42, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 44, 1)],
     );
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_extension_2_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
+    await assertErrorsInCode(
+      r'''
 extension A<T, U> on int {}
-''');
-
-    await assertErrorsInCode(
-      r'''
-part of 'a.dart';
-
 augment extension A<T> {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 40, 1)],
-    );
-  }
-
-  @SkippedTest() // TODO(scheglov): implement augmentation
-  test_extensionType_0_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-extension type A(int it) {}
-''');
-
-    await assertErrorsInCode(
-      r'''
-part of 'a.dart';
-
-augment extension type A<T>(int it) {}
-''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 43, 1)],
-    );
-  }
-
-  @SkippedTest() // TODO(scheglov): implement augmentation
-  test_extensionType_1_0() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-extension type A<T>(int it) {}
-''');
-
-    await assertErrorsInCode(
-      r'''
-part of 'a.dart';
-
-augment extension type A(int it) {}
-''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 42, 1)],
-    );
-  }
-
-  test_extensionType_1_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-extension type A<T>(int it) {}
-''');
-
-    await assertNoErrorsInCode(r'''
-part of 'a.dart';
-
-augment extension type A<T>(int it) {}
-''');
-  }
-
-  @SkippedTest() // TODO(scheglov): implement augmentation
-  test_extensionType_1_2() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-extension type A<T>(int it) {}
-''');
-
-    await assertErrorsInCode(
-      r'''
-part of 'a.dart';
-
-augment extension type A<T, U>(int it) {}
-''',
       [error(CompileTimeErrorCode.augmentationTypeParameterCount, 47, 1)],
     );
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
-  test_extensionType_2_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-extension type A<T, U>(int it) {}
-''');
-
+  test_extensionType_0_1() async {
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+extension type A(int it) {}
 augment extension type A<T>(int it) {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 45, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 52, 1)],
+    );
+  }
+
+  @SkippedTest() // TODO(scheglov): implement augmentation
+  test_extensionType_1_0() async {
+    await assertErrorsInCode(
+      r'''
+extension type A<T>(int it) {}
+augment extension type A(int it) {}
+''',
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 55, 1)],
+    );
+  }
+
+  test_extensionType_1_1() async {
+    await assertNoErrorsInCode(r'''
+extension type A<T>(int it) {}
+augment extension type A<T>(int it) {}
+''');
+  }
+
+  @SkippedTest() // TODO(scheglov): implement augmentation
+  test_extensionType_1_2() async {
+    await assertErrorsInCode(
+      r'''
+extension type A<T>(int it) {}
+augment extension type A<T, U>(int it) {}
+''',
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 55, 1)],
+    );
+  }
+
+  @SkippedTest() // TODO(scheglov): implement augmentation
+  test_extensionType_2_1() async {
+    await assertErrorsInCode(
+      r'''
+extension type A<T, U>(int it) {}
+augment extension type A<T>(int it) {}
+''',
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 58, 1)],
     );
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_mixin_0_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-mixin A {}
-''');
-
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+mixin A {}
 augment mixin A<T> {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 34, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 26, 1)],
     );
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_mixin_1_0() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-mixin A<T> {}
-''');
-
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+mixin A<T> {}
 augment mixin A {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 33, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 29, 1)],
     );
   }
 
   test_mixin_1_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-mixin A<T> {}
-''');
-
     await assertNoErrorsInCode(r'''
-part of 'a.dart';
-
+mixin A<T> {}
 augment mixin A<T> {}
 ''');
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_mixin_1_2() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-mixin A<T> {}
-''');
-
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+mixin A<T> {}
 augment mixin A<T, U> {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 38, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 29, 1)],
     );
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_mixin_2_1() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
-mixin A<T, U> {}
-''');
-
     await assertErrorsInCode(
       r'''
-part of 'a.dart';
-
+mixin A<T, U> {}
 augment mixin A<T> {}
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 36, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 32, 1)],
     );
   }
 
   @SkippedTest() // TODO(scheglov): implement augmentation
   test_mixin_method() async {
-    newFile('$testPackageLibPath/a.dart', r'''
-part 'test.dart';
-
+    await assertErrorsInCode(
+      r'''
 mixin A {
   void foo() {}
 }
-''');
-
-    await assertErrorsInCode(
-      r'''
-part of 'a.dart';
-
 augment mixin A<T> {
   augment void foo() {}
 }
 ''',
-      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 34, 1)],
+      [error(CompileTimeErrorCode.augmentationTypeParameterCount, 43, 1)],
     );
   }
 }