Initializing ExpectException's name to the empty string instead of null when no name is provided.
Change-Id: I2d9d6cafe3e25b1ecf1a9385405262c557887667 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/139325 Reviewed-by: Bob Nystrom <rnystrom@google.com> Commit-Queue: Mark Zhou <markzipan@google.com>
This commit is contained in:
committed by
commit-bot@chromium.org
parent
a42efec049
commit
28fb096cfc
@@ -703,10 +703,10 @@ class ExpectException {
|
||||
final String name;
|
||||
|
||||
ExpectException(this.message)
|
||||
: name = (_getTestName == null) ? null : _getTestName();
|
||||
: name = (_getTestName == null) ? "" : _getTestName();
|
||||
|
||||
String toString() {
|
||||
if (name != null) return 'In test "$name" $message';
|
||||
if (name != "") return 'In test "$name" $message';
|
||||
return message;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user