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

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

Issue 14333023: The matcher argument to the CustomMatcher constructor no longer has to be a matcher; it will be wra… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 8 months 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/lib/src/core_matchers.dart ('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 library unittestTests; 5 library unittestTests;
6 import 'package:unittest/unittest.dart'; 6 import 'package:unittest/unittest.dart';
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 part 'test_utils.dart'; 9 part 'test_utils.dart';
10 10
(...skipping 689 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 shouldFail(0, predicate((x) => x is String, "an instance of String"), 700 shouldFail(0, predicate((x) => x is String, "an instance of String"),
701 "Expected: an instance of String but: was <0>."); 701 "Expected: an instance of String but: was <0>.");
702 shouldPass('cow', predicate((x) => x is String, "an instance of String")); 702 shouldPass('cow', predicate((x) => x is String, "an instance of String"));
703 }); 703 });
704 }); 704 });
705 705
706 group('Feature Matchers', () { 706 group('Feature Matchers', () {
707 test("Feature Matcher", () { 707 test("Feature Matcher", () {
708 var w = new Widget(); 708 var w = new Widget();
709 w.price = 10; 709 w.price = 10;
710 shouldPass(w, new HasPrice(10));
710 shouldPass(w, new HasPrice(greaterThan(0))); 711 shouldPass(w, new HasPrice(greaterThan(0)));
711 shouldFail(w, new HasPrice(greaterThan(10)), 712 shouldFail(w, new HasPrice(greaterThan(10)),
712 'Expected: Widget with a price that is a value greater than <10> ' 713 'Expected: Widget with a price that is a value greater than <10> '
713 'but: price was <10>.'); 714 'but: price was <10>.');
714 }); 715 });
715 }); 716 });
716 } 717 }
717 718
OLDNEW
« no previous file with comments | « pkg/unittest/lib/src/core_matchers.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698