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

Side by Side Diff: pkg/matcher/test/core_matchers_test.dart

Issue 763783003: Add isNotEmpty to core_matchers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Style fixes Created 6 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/matcher/lib/src/core_matchers.dart ('k') | pkg/matcher/test/iterable_matchers_test.dart » ('j') | 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 matcher.core_matchers_test; 5 library matcher.core_matchers_test;
6 6
7 import 'package:matcher/matcher.dart'; 7 import 'package:matcher/matcher.dart';
8 import 'package:unittest/unittest.dart' show test, group; 8 import 'package:unittest/unittest.dart' show test, group;
9 9
10 import 'test_utils.dart'; 10 import 'test_utils.dart';
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 test('returnsNormally', () { 86 test('returnsNormally', () {
87 shouldPass(doesNotThrow, returnsNormally); 87 shouldPass(doesNotThrow, returnsNormally);
88 shouldFail(doesThrow, returnsNormally, 88 shouldFail(doesThrow, returnsNormally,
89 matches( 89 matches(
90 r"Expected: return normally" 90 r"Expected: return normally"
91 r" Actual: <Closure(: \(\) => dynamic " 91 r" Actual: <Closure(: \(\) => dynamic "
92 r"from Function 'doesThrow': static\.)?>" 92 r"from Function 'doesThrow': static\.)?>"
93 r" Which: threw 'X'")); 93 r" Which: threw 'X'"));
94 }); 94 });
95 95
96
97 test('hasLength', () { 96 test('hasLength', () {
98 var a = new Map(); 97 var a = new Map();
99 var b = new List(); 98 var b = new List();
100 shouldPass(a, hasLength(0)); 99 shouldPass(a, hasLength(0));
101 shouldPass(b, hasLength(0)); 100 shouldPass(b, hasLength(0));
102 shouldPass('a', hasLength(1)); 101 shouldPass('a', hasLength(1));
103 shouldFail(0, hasLength(0), new PrefixMatcher( 102 shouldFail(0, hasLength(0), new PrefixMatcher(
104 "Expected: an object with length of <0> " 103 "Expected: an object with length of <0> "
105 "Actual: <0> " 104 "Actual: <0> "
106 "Which: has no length property")); 105 "Which: has no length property"));
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 }); 170 });
172 171
173 group('Predicate Matchers', () { 172 group('Predicate Matchers', () {
174 test('isInstanceOf', () { 173 test('isInstanceOf', () {
175 shouldFail(0, predicate((x) => x is String, "an instance of String"), 174 shouldFail(0, predicate((x) => x is String, "an instance of String"),
176 "Expected: an instance of String Actual: <0>"); 175 "Expected: an instance of String Actual: <0>");
177 shouldPass('cow', predicate((x) => x is String, "an instance of String")); 176 shouldPass('cow', predicate((x) => x is String, "an instance of String"));
178 }); 177 });
179 }); 178 });
180 } 179 }
OLDNEW
« no previous file with comments | « pkg/matcher/lib/src/core_matchers.dart ('k') | pkg/matcher/test/iterable_matchers_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698