OLD | NEW |
---|---|
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 library observe.test.observe_test_utils; | 5 library observe.test.observe_test_utils; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:observe/observe.dart'; | 8 import 'package:observe/observe.dart'; |
9 import 'package:observe/mirrors_used.dart' as mu; // to make tests smaller | 9 import 'package:observe/mirrors_used.dart' as mu; // to make tests smaller |
10 import 'package:observe/src/dirty_check.dart'; | 10 import 'package:observe/src/dirty_check.dart'; |
(...skipping 24 matching lines...) Expand all Loading... | |
35 /// future.then(newMicrotask).then(...) | 35 /// future.then(newMicrotask).then(...) |
36 /// | 36 /// |
37 /// Uses [mu]. | 37 /// Uses [mu]. |
38 newMicrotask(_) => new Future.value(); | 38 newMicrotask(_) => new Future.value(); |
39 | 39 |
40 // TODO(jmesserly): use matchers when we have a way to compare ChangeRecords. | 40 // TODO(jmesserly): use matchers when we have a way to compare ChangeRecords. |
41 // For now just use the toString. | 41 // For now just use the toString. |
42 expectChanges(actual, expected, {reason}) => | 42 expectChanges(actual, expected, {reason}) => |
43 expect('$actual', '$expected', reason: reason); | 43 expect('$actual', '$expected', reason: reason); |
44 | 44 |
45 List getListChangeRecords(List changes, int index) => changes | 45 List<ListChangeRecord> getListChangeRecords(List changes, int index) => |
46 .where((c) => c.indexChanged(index)).toList(); | 46 new List.from(changes.where((c) => c.indexChanged(index))); |
Siggi Cherem (dart-lang)
2016/03/25 17:36:29
I'm surprised that you need to replace `.toList` w
Jennifer Messerly
2016/03/25 18:23:23
they're different.
changes -- is probably a List<
Siggi Cherem (dart-lang)
2016/03/25 18:30:01
Ah - sorry, for a moment I thought we inferred Lis
| |
47 | 47 |
48 List getPropertyChangeRecords(List changes, Symbol property) => changes | 48 List<PropertyChangeRecord> getPropertyChangeRecords( |
49 .where((c) => c is PropertyChangeRecord && c.name == property).toList(); | 49 List changes, Symbol property) => |
50 new List.from( | |
51 changes.where((c) => c is PropertyChangeRecord && c.name == property)); | |
OLD | NEW |