Skip to content

Conversation

@munificent
Copy link
Member

When I made the style changes language versions for Dart 3.8, I changed how tests are written to allow a single test to have different expected outputs at different language versions.

I was pressed for time, so that broke the automated test updater which doesn't know how to handle versions. This gets it working again.

In the process, I decided to tweak how the final newline in test files is handled. For years, I avoided having a trailing newline because I though it would confuse the formatter. At some point that may have even been true. But it turns out to be fine and it's more idiomatic to have a trailing newline at the end of a text file.

The test updater now ensures that and I went ahead and normalized all of the tests to have trailing newlines. There are no other changes to the test files. The only actual change in this PR is at the very end in tool/update_tests.dart.

When I made the style changes language versions for Dart 3.8, I changed
how tests are written to allow a single test to have different expected
outputs at different language versions.

I was pressed for time, so that broke the automated test updater which
doesn't know how to handle versions. This gets it working again.

In the process, I decided to tweak how the final newline in test files
is handled. For years, I avoided having a trailing newline because I
though it would confuse the formatter. At some point that may have even
been true. But it turns out to be fine and it's more idiomatic to have a
trailing newline at the end of a text file.

The test updater now ensures that and I went ahead and normalized all
of the tests to have trailing newlines. There are no other changes to
the test files.
@munificent munificent requested review from kallentu and natebosch July 17, 2025 18:00
@munificent munificent merged commit ac2650a into main Jul 17, 2025
7 checks passed
@munificent munificent deleted the fix-test-updater branch July 17, 2025 22:40
munificent added a commit that referenced this pull request Jul 28, 2025
When I made the style changes language versions for Dart 3.8, I changed
how tests are written to allow a single test to have different expected
outputs at different language versions.

I was pressed for time, so that broke the automated test updater which
doesn't know how to handle versions. This gets it working again.

In the process, I decided to tweak how the final newline in test files
is handled. For years, I avoided having a trailing newline because I
though it would confuse the formatter. At some point that may have even
been true. But it turns out to be fine and it's more idiomatic to have a
trailing newline at the end of a text file.

The test updater now ensures that and I went ahead and normalized all
of the tests to have trailing newlines. There are no other changes to
the test files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants