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

Unified Diff: tests/html/element_classes_test.dart

Issue 26280002: Set.add returns true if item has been added, otherwise false (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: again Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/corelib/set_test.dart ('k') | tools/dom/src/CssClassSet.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/element_classes_test.dart
diff --git a/tests/html/element_classes_test.dart b/tests/html/element_classes_test.dart
index f4ed7a4e6189ca4ac5a09747e9cb1c74ba1cfce3..9ef98604f056f1d880bf9d4fd069af6c89e3d1c0 100644
--- a/tests/html/element_classes_test.dart
+++ b/tests/html/element_classes_test.dart
@@ -107,10 +107,12 @@ main() {
test('add', () {
final classes = makeClassSet();
- classes.add('qux');
+ var added = classes.add('qux');
+ expect(added, isTrue);
expect(classes, orderedEquals(['foo', 'bar', 'baz', 'qux']));
- classes.add('qux');
+ added = classes.add('qux');
+ expect(added, isFalse);
final list = new List.from(classes);
list.sort((a, b) => a.compareTo(b));
expect(list, orderedEquals(['bar', 'baz', 'foo', 'qux']),
@@ -235,7 +237,9 @@ main() {
test('listAdd', () {
var elements = listElementSetup();
- elements.classes.add('lassie');
+ var added = elements.classes.add('lassie');
+ expect(added, isNull);
+
expect(elements.classes,
unorderedEquals(['lassie', 'qux', 'quux', 'meta', 'classy', 'lassy']));
for (Element e in elements) {
« no previous file with comments | « tests/corelib/set_test.dart ('k') | tools/dom/src/CssClassSet.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698