@@ -459,34 +459,40 @@ void main() {
459
459
});
460
460
461
461
test ('==' , () {
462
- expect (Int64 (0 ), equals (Int64 (0 )));
463
- expect (Int64 (0 ), isNot (equals (Int64 (1 ))));
464
- expect (Int64 (0 ), equals (Int32 (0 )));
465
- expect (Int64 (0 ), isNot (equals (Int32 (1 ))));
466
- expect (Int64 (0 ) == 0 , isTrue); // ignore: unrelated_type_equality_checks
467
- expect (Int64 (0 ), isNot (equals (1 )));
468
- expect (Int64 (10 ), isNot (equals (Int64 (11 ))));
469
- expect (Int64 (10 ), equals (Int64 (10 )));
470
- expect (Int64 (10 ), isNot (equals (Int64 (9 ))));
471
- expect (Int64 (10 ), isNot (equals (Int32 (11 ))));
472
- expect (Int64 (10 ), equals (Int32 (10 )));
473
- expect (Int64 (10 ), isNot (equals (Int32 (9 ))));
474
- expect (Int64 (10 ), isNot (equals (11 )));
475
- expect (Int64 (10 ) == 10 , isTrue); // ignore: unrelated_type_equality_checks
476
- expect (Int64 (10 ), isNot (equals (9 )));
477
- expect (Int64 (- 10 ), equals (Int64 (- 10 )));
462
+ // Note: do not use `equals` matcher below as it considers exceptions as
463
+ // `false`. See issue #910.
464
+ expect (Int64 (0 ) == Int64 (0 ), true );
465
+ expect (Int64 (0 ) == Int64 (1 ), false );
466
+ // ignore: unrelated_type_equality_checks
467
+ expect (Int64 (0 ) == Int32 (0 ), true );
468
+ // ignore: unrelated_type_equality_checks
469
+ expect (Int64 (0 ) == Int32 (1 ), false );
470
+ expect (Int64 (0 ) == 0 , true );
471
+ expect (Int64 (0 ) == 1 , false );
472
+ expect (Int64 (10 ) == Int64 (11 ), false );
473
+ expect (Int64 (10 ) == Int64 (10 ), true );
474
+ expect (Int64 (10 ) == Int64 (9 ), false );
475
+ // ignore: unrelated_type_equality_checks
476
+ expect (Int64 (10 ) == Int32 (11 ), false );
477
+ // ignore: unrelated_type_equality_checks
478
+ expect (Int64 (10 ) == Int32 (10 ), true );
479
+ // ignore: unrelated_type_equality_checks
480
+ expect (Int64 (10 ) == Int32 (9 ), false );
481
+ expect (Int64 (10 ) == 11 , false );
482
+ expect (Int64 (10 ) == 10 , true );
483
+ expect (Int64 (10 ) == 9 , false );
484
+ expect (Int64 (- 10 ) == Int64 (- 10 ), true );
478
485
expect (Int64 (- 10 ) != Int64 (- 10 ), false );
479
- expect (
480
- Int64 (- 10 ) == - 10 ,
481
- isTrue,
482
- ); // ignore: unrelated_type_equality_checks
483
- expect (Int64 (- 10 ), isNot (equals (- 9 )));
484
- expect (largePos, equals (largePos));
485
- expect (largePos, isNot (equals (largePosPlusOne)));
486
- expect (largePosPlusOne, isNot (equals (largePos)));
487
- expect (Int64 .MIN_VALUE , isNot (equals (Int64 .MAX_VALUE )));
488
- expect (Int64 (17 ), isNot (equals (Object ())));
489
- expect (Int64 (17 ), isNot (equals (null )));
486
+ // ignore: unrelated_type_equality_checks
487
+ expect (Int64 (- 10 ) == - 10 , true );
488
+ expect (Int64 (- 10 ) == - 9 , false );
489
+ expect (largePos == largePos, true );
490
+ expect (largePos == largePosPlusOne, false );
491
+ expect (largePosPlusOne == largePos, false );
492
+ expect (Int64 .MIN_VALUE == Int64 .MAX_VALUE , false );
493
+ expect (Int64 (17 ) == Object (), false );
494
+ // ignore: unnecessary_null_comparison
495
+ expect (Int64 (17 ) == null , false );
490
496
});
491
497
492
498
test ('>=' , () {
0 commit comments