Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: pkg/unittest/test/matchers_test.dart

Issue 116273006: Implement _UnorderedEquals in terms of _UnorderedMatches in pkg/unittest. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pkg/unittest/pubspec.yaml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'dart:async'; 5 import 'dart:async';
6 import 'dart:collection'; 6 import 'dart:collection';
7 7
8 import 'package:unittest/unittest.dart'; 8 import 'package:unittest/unittest.dart';
9 9
10 import 'test_utils.dart'; 10 import 'test_utils.dart';
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
474 "Expected: equals [1] unordered " 474 "Expected: equals [1] unordered "
475 "Actual: [1, 2] " 475 "Actual: [1, 2] "
476 "Which: has too many elements (2 > 1)"); 476 "Which: has too many elements (2 > 1)");
477 shouldFail(d, unorderedEquals([3, 2, 1]), 477 shouldFail(d, unorderedEquals([3, 2, 1]),
478 "Expected: equals [3, 2, 1] unordered " 478 "Expected: equals [3, 2, 1] unordered "
479 "Actual: [1, 2] " 479 "Actual: [1, 2] "
480 "Which: has too few elements (2 < 3)"); 480 "Which: has too few elements (2 < 3)");
481 shouldFail(d, unorderedEquals([3, 1]), 481 shouldFail(d, unorderedEquals([3, 1]),
482 "Expected: equals [3, 1] unordered " 482 "Expected: equals [3, 1] unordered "
483 "Actual: [1, 2] " 483 "Actual: [1, 2] "
484 "Which: has no match for element <3> at index 0"); 484 "Which: has no match for <3> at index 0");
485 }); 485 });
486 486
487 test('unorderedMatchess', () { 487 test('unorderedMatchess', () {
488 var d = [1, 2]; 488 var d = [1, 2];
489 shouldPass(d, unorderedMatches([2, 1])); 489 shouldPass(d, unorderedMatches([2, 1]));
490 shouldPass(d, unorderedMatches([greaterThan(1), greaterThan(0)])); 490 shouldPass(d, unorderedMatches([greaterThan(1), greaterThan(0)]));
491 shouldFail(d, unorderedMatches([greaterThan(0)]), 491 shouldFail(d, unorderedMatches([greaterThan(0)]),
492 "Expected: matches [a value greater than <0>] unordered " 492 "Expected: matches [a value greater than <0>] unordered "
493 "Actual: [1, 2] " 493 "Actual: [1, 2] "
494 "Which: has too many elements (2 > 1)"); 494 "Which: has too many elements (2 > 1)");
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 779
780 X() { 780 X() {
781 print(foo); 781 print(foo);
782 } 782 }
783 } 783 }
784 784
785 abstract class Abstraction { 785 abstract class Abstraction {
786 void norealization(); 786 void norealization();
787 } 787 }
788 788
OLDNEW
« no previous file with comments | « pkg/unittest/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698