From 139d6b625223ee987c6451be86e2fb312c22f2ad Mon Sep 17 00:00:00 2001 From: Robert Nystrom Date: Tue, 31 Oct 2023 11:22:32 -0700 Subject: [PATCH] Make a new test folder for variable tests. Variables (and soon, functions) are sort of weird because they can occur at the top level and as statements. It's not clear where they should go. Before this PR, they were in both top_level/ and statement/. This moves them to their own test directory. I'll be doing the same thing for functions too. --- test/README.md | 15 +++++++++------ test/tall_format_test.dart | 1 + .../variable.stmt => variable/local.stmt} | 0 .../local_comment.stmt} | 0 .../variable.unit => variable/top_level.unit} | 0 .../top_level_comment.unit} | 0 6 files changed, 10 insertions(+), 6 deletions(-) rename test/{statement/variable.stmt => variable/local.stmt} (100%) rename test/{statement/variable_comment.stmt => variable/local_comment.stmt} (100%) rename test/{top_level/variable.unit => variable/top_level.unit} (100%) rename test/{top_level/variable_comment.unit => variable/top_level_comment.unit} (100%) diff --git a/test/README.md b/test/README.md index 45d62495..8fa7bcc3 100644 --- a/test/README.md +++ b/test/README.md @@ -63,12 +63,15 @@ These tests are all run by `short_format_test.dart`. The newer tall style tests are: ``` -expression/ - Test formatting expressions. -invocation/ - Test formatting function and member invocations. -member/ - Test formatting class/enum/extension/mixin member declarations. -statement/ - Test formatting statements. -top_level/ - Test formatting top-level declarations and directives. -type/ - Test formatting type annotations. +declaration/ - Typedef, class, enum, and extension declarations. +expression/ - Expressions. +invocation/ - Function and member invocations. +member/ - Constructor, method, field, getter, and setter declarations. +selection/ - Test preserving selection information. +statement/ - Statements. +top_level/ - Top-level directives. +type/ - Type annotations. +variable/ - Top-level and local variable declarations. ``` These tests are all run by `tall_format_test.dart`. diff --git a/test/tall_format_test.dart b/test/tall_format_test.dart index 39cc0e93..decea20c 100644 --- a/test/tall_format_test.dart +++ b/test/tall_format_test.dart @@ -15,6 +15,7 @@ void main() async { await testDirectory('statement', tall: true); await testDirectory('top_level', tall: true); await testDirectory('type', tall: true); + await testDirectory('variable', tall: true); // TODO(tall): The old formatter_test.dart has tests here for things like // trailing newlines. Port those over to the new style once it supports all diff --git a/test/statement/variable.stmt b/test/variable/local.stmt similarity index 100% rename from test/statement/variable.stmt rename to test/variable/local.stmt diff --git a/test/statement/variable_comment.stmt b/test/variable/local_comment.stmt similarity index 100% rename from test/statement/variable_comment.stmt rename to test/variable/local_comment.stmt diff --git a/test/top_level/variable.unit b/test/variable/top_level.unit similarity index 100% rename from test/top_level/variable.unit rename to test/variable/top_level.unit diff --git a/test/top_level/variable_comment.unit b/test/variable/top_level_comment.unit similarity index 100% rename from test/top_level/variable_comment.unit rename to test/variable/top_level_comment.unit