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

Side by Side Diff: pkg/matcher/test/matchers_minified_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
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 // This file is for matcher tests that rely on the names of various Dart types. 5 // This file is for matcher tests that rely on the names of various Dart types.
6 // These tests normally fail when run in minified dart2js, since the names will 6 // These tests normally fail when run in minified dart2js, since the names will
7 // be mangled. This version of the file is modified to expect minified names. 7 // be mangled. This version of the file is modified to expect minified names.
8 8
9 library matcher.minified_test; 9 library matcher.minified_test;
10 10
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 group('Iterable Matchers', () { 103 group('Iterable Matchers', () {
104 test('isEmpty', () { 104 test('isEmpty', () {
105 var d = new SimpleIterable(0); 105 var d = new SimpleIterable(0);
106 var e = new SimpleIterable(1); 106 var e = new SimpleIterable(1);
107 shouldPass(d, isEmpty); 107 shouldPass(d, isEmpty);
108 shouldFail(e, isEmpty, 108 shouldFail(e, isEmpty,
109 matches(r"Expected: empty +Actual: " + _MINIFIED_NAME + r":\[1\]")); 109 matches(r"Expected: empty +Actual: " + _MINIFIED_NAME + r":\[1\]"));
110 }); 110 });
111 111
112 test('isNotEmpty', () {
113 var d = new SimpleIterable(0);
114 var e = new SimpleIterable(1);
115 shouldPass(e, isNotEmpty);
116 shouldFail(d, isNotEmpty,
117 matches(r"Expected: non-empty +Actual: " + _MINIFIED_NAME + r":\[\]")) ;
118 });
119
112 test('contains', () { 120 test('contains', () {
113 var d = new SimpleIterable(3); 121 var d = new SimpleIterable(3);
114 shouldPass(d, contains(2)); 122 shouldPass(d, contains(2));
115 shouldFail(d, contains(5), 123 shouldFail(d, contains(5),
116 matches( 124 matches(
117 r"Expected: contains <5> +" 125 r"Expected: contains <5> +"
118 r"Actual: " + _MINIFIED_NAME + r":\[3, 2, 1\]")); 126 r"Actual: " + _MINIFIED_NAME + r":\[3, 2, 1\]"));
119 }); 127 });
120 }); 128 });
121 129
122 group('Feature Matchers', () { 130 group('Feature Matchers', () {
123 test("Feature Matcher", () { 131 test("Feature Matcher", () {
124 var w = new Widget(); 132 var w = new Widget();
125 w.price = 10; 133 w.price = 10;
126 shouldPass(w, new HasPrice(10)); 134 shouldPass(w, new HasPrice(10));
127 shouldPass(w, new HasPrice(greaterThan(0))); 135 shouldPass(w, new HasPrice(greaterThan(0)));
128 shouldFail(w, new HasPrice(greaterThan(10)), 136 shouldFail(w, new HasPrice(greaterThan(10)),
129 matches( 137 matches(
130 r"Expected: Widget with a price that is a value greater than " 138 r"Expected: Widget with a price that is a value greater than "
131 r"<10> +" 139 r"<10> +"
132 r"Actual: <Instance of '" + _MINIFIED_NAME + r"'> +" 140 r"Actual: <Instance of '" + _MINIFIED_NAME + r"'> +"
133 r"Which: has price with value <10> which is not " 141 r"Which: has price with value <10> which is not "
134 r"a value greater than <10>")); 142 r"a value greater than <10>"));
135 }); 143 });
136 }); 144 });
137 } 145 }
OLDNEW
« no previous file with comments | « pkg/matcher/test/iterable_matchers_test.dart ('k') | pkg/matcher/test/matchers_unminified_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698