checks: improve output of toStringEquals test extension
diff --git a/pkgs/checks/test/test_shared.dart b/pkgs/checks/test/test_shared.dart
index 4ad7ef8..d631489 100644
--- a/pkgs/checks/test/test_shared.dart
+++ b/pkgs/checks/test/test_shared.dart
@@ -9,12 +9,18 @@
// TODO: remove this once we have a deepEquals or equivalent
void toStringEquals(List<String>? other) {
final otherToString = other.toString();
- context.expect(() => ['toString equals'], (actual) {
- final actualToString = actual.toString();
- return actual.toString() == otherToString
- ? null
- : Rejection(actual: actualToString);
- });
+ context.expect(
+ () => ['toString equals ${literal(otherToString)}'],
+ (actual) {
+ final actualToString = actual.toString();
+ return actualToString == otherToString
+ ? null
+ : Rejection(
+ actual: actualToString,
+ which: ['does not have a matching toString'],
+ );
+ },
+ );
}
}