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

Side by Side Diff: pkg/observe/test/observable_list_test.dart

Issue 82593004: [observe] add isEmpty/isNotEmpty to ObservableList reflection (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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/observe/lib/src/observable_list.dart ('k') | pkg/observe/test/path_observer_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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 'package:observe/observe.dart'; 6 import 'package:observe/observe.dart';
7 import 'package:unittest/unittest.dart'; 7 import 'package:unittest/unittest.dart';
8 import 'observe_test_utils.dart'; 8 import 'observe_test_utils.dart';
9 9
10 main() { 10 main() {
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
246 _change(1, addedCount: 1), 246 _change(1, addedCount: 1),
247 _change(4, removed: [1]) 247 _change(4, removed: [1])
248 ]); 248 ]);
249 }); 249 });
250 250
251 observeTest('clear', () { 251 observeTest('clear', () {
252 list.clear(); 252 list.clear();
253 expect(list, []); 253 expect(list, []);
254 254
255 performMicrotaskCheckpoint(); 255 performMicrotaskCheckpoint();
256 expectChanges(propRecords, [_lengthChange(6, 0)]); 256 expectChanges(propRecords, [
257 _lengthChange(6, 0),
258 new PropertyChangeRecord(list, #isEmpty, false, true),
259 new PropertyChangeRecord(list, #isNotEmpty, true, false),
260 ]);
257 expectChanges(listRecords, [_change(0, removed: [1, 2, 3, 1, 3, 4])]); 261 expectChanges(listRecords, [_change(0, removed: [1, 2, 3, 1, 3, 4])]);
258 }); 262 });
259 }); 263 });
260 } 264 }
261 265
262 ObservableList list; 266 ObservableList list;
263 267
264 _lengthChange(int oldValue, int newValue) => 268 _lengthChange(int oldValue, int newValue) =>
265 new PropertyChangeRecord(list, #length, oldValue, newValue); 269 new PropertyChangeRecord(list, #length, oldValue, newValue);
266 270
267 _change(index, {removed: const [], addedCount: 0}) => new ListChangeRecord( 271 _change(index, {removed: const [], addedCount: 0}) => new ListChangeRecord(
268 list, index, removed: removed, addedCount: addedCount); 272 list, index, removed: removed, addedCount: addedCount);
OLDNEW
« no previous file with comments | « pkg/observe/lib/src/observable_list.dart ('k') | pkg/observe/test/path_observer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698