You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When pairwiseCompare compares values of different types a confusing (more confusing if the types get longer) error message appears:
Log
Building package executable... (7.9s)
Built test:test.
00:01 +0 -1: test/bug_test.dart: throws has <null> which is not description <null> at index null [E]
Expected: pairwise ['a']
Actual: [1]
Which: has <null> which is not <null> at index null
type 'int' is not a subtype of type 'String' in type cast at #0 _PairwiseCompare.typedMatches (package:matcher/src/iterable_matchers.dart:266:44)
#1 FeatureMatcher.matches (package:matcher/src/feature_matcher.dart:16:42)
#2 _expect (package:matcher/src/expect/expect.dart:138:30)
#3 expect (package:matcher/src/expect/expect.dart:56:3)
#4 main.<anonymous closure> (file:///home/rrausch/Code/bug/test/bug_test.dart:6:5)
#5 Declarer.test.<anonymous closure>.<anonymous closure> (package:test_api/src/backend/declarer.dart:229:19)
<asynchronous suspension>
#6 Declarer.test.<anonymous closure> (package:test_api/src/backend/declarer.dart:227:7)
<asynchronous suspension>
#7 Invoker._waitForOutstandingCallbacks.<anonymous closure> (package:test_api/src/backend/invoker.dart:258:9)
<asynchronous suspension>
package:matcher expect
test/bug_test.dart 6:5 main.<fn>
To run this test again: /home/rrausch/Code/flutter/bin/cache/dart-sdk/bin/dart test test/bug_test.dart -p vm --plain-name 'throws has <null> which is not description <null> at index null'
00:01 +0 -1: Some tests failed.
Consider enabling the flag chain-stack-traces to receive more detailed exceptions.
For example, 'dart test --chain-stack-traces'.
dart test 9.71s user 1.13s system 101% cpu 10.649 total
To reproduce
dart create bug
add code sample to test/bug_test.dart
dart test
Code sample
test('throws has <null> which is not description <null> at index null', () {
expect([1], pairwiseCompare(['a'], (String a, String b) => a == b, ''));
});
env
dart --version:
Dart SDK version: 3.6.1 (stable) (Tue Jan 7 09:50:00 2025 -0800) on "linux_x64"
When
pairwiseCompare
compares values of different types a confusing (more confusing if the types get longer) error message appears:Log
To reproduce
dart create bug
dart test
Code sample
env
dart --version
:Dart SDK version: 3.6.1 (stable) (Tue Jan 7 09:50:00 2025 -0800) on "linux_x64"
pubspec.lock
The text was updated successfully, but these errors were encountered: