Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(632)

Unified Diff: tests/language/function_type/test_generator.dart

Issue 2707033004: Add generated function_type tests. (Closed)
Patch Set: Don't format, since the formatter drops type-arguments. Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/language/function_type/function_type9_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/language/function_type/test_generator.dart
diff --git a/tests/language/function_type/test_generator.dart b/tests/language/function_type/test_generator.dart
index c9f14ec05eb50e345eb9ab7f0c85d8513478ca28..dfdb8b39cca6765e5fb69c04e85a5b37fc562404 100644
--- a/tests/language/function_type/test_generator.dart
+++ b/tests/language/function_type/test_generator.dart
@@ -547,6 +547,7 @@ final bool inCheckedMode =
""";
class Unit {
+ int typeCounter = 0;
final String name;
final StringBuffer typedefs = new StringBuffer();
final StringBuffer globals = new StringBuffer();
@@ -593,8 +594,8 @@ void main() {
}
final TEST_METHOD_HEADER = """
- void #testName() {
- // #typeCode""";
+ /// #typeCode
+ void #testName() {""";
// Tests that apply for every type.
final COMMON_TESTS_TEMPLATE = """
@@ -718,9 +719,11 @@ void generateTests() {
var types = buildFunctionTypes();
- int typeCounter = 0;
+ int unitCounter = 0;
types.forEach((FunctionType type) {
- Unit unit = units[typeCounter % units.length];
+ Unit unit = units[unitCounter % units.length];
+ unitCounter++;
+ int typeCounter = unit.typeCounter++;
String typeName = createTypeName(typeCounter);
String fieldName = createFieldName(typeCounter);
@@ -738,8 +741,6 @@ void generateTests() {
unit.methods.writeln(" $methodFunCode");
unit.testMethods.writeln("$testMethodCode");
unit.tests.writeln(" $testName();");
-
- typeCounter++;
});
for (int i = 0; i < units.length; i++) {
« no previous file with comments | « tests/language/function_type/function_type9_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698