This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Extract Dart test utilities library#20874
Merged
cbracken merged 1 commit intoflutter:masterfrom Aug 30, 2020
cbracken:extract-test-utils
Merged
Extract Dart test utilities library#20874cbracken merged 1 commit intoflutter:masterfrom cbracken:extract-test-utils
cbracken merged 1 commit intoflutter:masterfrom
cbracken:extract-test-utils
Conversation
Member
Author
|
For what it's worth, I think these implementations could be simplified and I'll probably send a cleanup PR once I've landed the |
This extracts a Dart test utilities library, containing `expectAssertion` and `expectArgumentError` functions that simplify running tests that test assertions across debug, profile, and release configurations. This change also restricts Dart unit tests to testing files whose filename matches `*_test.dart` under `flutter/testing/dart`; previously any file in that directory was run, but all files matched the above pattern.
This was referenced Aug 29, 2020
xster
reviewed
Aug 30, 2020
| /// specified callback throws an [AssertionError]. When asserts are not | ||
| /// enabled, such as when running using a release-mode VM with default | ||
| /// settings, this acts as a no-op. | ||
| void expectAssertion(Function callback) { |
Member
There was a problem hiding this comment.
random unsolicited note (since you asked :D) why not give it a class and a function to just expectThrows instead? Something like https://www.codota.com/code/java/methods/org.testng.Assert/expectThrows
Member
Author
There was a problem hiding this comment.
Interesting. Will land this as-is so I can use it for the lerp tests, but as I say, planning to do a cleanup so will take a look!
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Aug 30, 2020
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This extracts a Dart test utilities library, containing
expectAssertionandexpectArgumentErrorfunctions that simplify running tests that test assertions across debug, profile, and release configurations.This change also restricts Dart unit tests to testing files whose filename matches
*_test.dartunderflutter/testing/dart; previously any file in that directory was run, but all files matched the above pattern.