OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 library observe.test.observe_test_utils; | |
6 | |
7 import 'dart:async'; | |
8 import 'package:observe/observe.dart'; | |
9 import 'package:observe/mirrors_used.dart'; // to make tests smaller | |
10 import 'package:unittest/unittest.dart'; | |
11 export 'package:observe/src/dirty_check.dart' show dirtyCheckZone; | |
12 | |
13 /// A small method to help readability. Used to cause the next "then" in a chain | |
14 /// to happen in the next microtask: | |
15 /// | |
16 /// future.then(newMicrotask).then(...) | |
17 newMicrotask(_) => new Future.value(); | |
18 | |
19 // TODO(jmesserly): use matchers when we have a way to compare ChangeRecords. | |
20 // For now just use the toString. | |
21 expectChanges(actual, expected, {reason}) => | |
22 expect('$actual', '$expected', reason: reason); | |
23 | |
24 List getListChangeRecords(List changes, int index) => changes | |
25 .where((c) => c.indexChanged(index)).toList(); | |
26 | |
27 List getPropertyChangeRecords(List changes, Symbol property) => changes | |
28 .where((c) => c is PropertyChangeRecord && c.name == property).toList(); | |
OLD | NEW |