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

Unified Diff: packages/observable/test/observable_map_test.dart

Issue 2989763002: Update charted to 0.4.8 and roll (Closed)
Patch Set: Removed Cutch from list of reviewers Created 3 years, 5 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 | « packages/observable/test/observable_list_test.dart ('k') | packages/observable/test/observable_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/observable/test/observable_map_test.dart
diff --git a/packages/observe/test/observable_map_test.dart b/packages/observable/test/observable_map_test.dart
similarity index 93%
rename from packages/observe/test/observable_map_test.dart
rename to packages/observable/test/observable_map_test.dart
index ee494c488b0c3a82416bb8a18d179febaf5af987..a424ce1fd216b5cb7ac0e25629cadbc1985bb6b0 100644
--- a/packages/observe/test/observable_map_test.dart
+++ b/packages/observable/test/observable_map_test.dart
@@ -1,13 +1,15 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:async';
-import 'package:observe/observe.dart';
-import 'package:unittest/unittest.dart';
-import 'observe_test_utils.dart';
-main() => dirtyCheckZone().run(_runTests);
+import 'package:observable/observable.dart';
+import 'package:test/test.dart';
+
+import 'observable_test_utils.dart';
+
+main() => _runTests();
_runTests() {
// TODO(jmesserly): need all standard Map API tests.
@@ -58,7 +60,7 @@ _runTests() {
return new Future(() {
expectChanges(changes, [
_lengthChange(map, 3, 2),
- _lengthChange(map, 2, 1)
+ _lengthChange(map, 2, 1),
]);
});
});
@@ -89,7 +91,6 @@ _runTests() {
});
group('observe item', () {
-
ObservableMap map;
List<ChangeRecord> changes;
@@ -97,8 +98,8 @@ _runTests() {
map = toObservable({'a': 1, 'b': 2, 'c': 3});
changes = null;
sub = map.changes.listen((records) {
- changes = records.where((r) => r is MapChangeRecord && r.key == 'b')
- .toList();
+ changes =
+ records.where((r) => r is MapChangeRecord && r.key == 'b').toList();
});
});
@@ -140,7 +141,7 @@ _runTests() {
map['c'] = 9000;
expect(map, {'a': 1, 'b': 2, 'c': 9000});
return new Future(() {
- expectChanges(changes, []);
+ expectChanges(changes, []);
});
});
@@ -151,7 +152,7 @@ _runTests() {
return new Future(() {
expectChanges(changes, [
_changeKey('b', 2, 9001),
- _changeKey('b', 9001, 42)
+ _changeKey('b', 9001, 42),
]);
});
});
@@ -177,8 +178,10 @@ _runTests() {
map['b'] = 2;
expect(map, {'a': 1, 'b': 2, 'c': 3});
return new Future(() {
- expectChanges(changes,
- [_removeKey('b', 2), _insertKey('b', 2)]);
+ expectChanges(changes, [
+ _removeKey('b', 2),
+ _insertKey('b', 2),
+ ]);
});
});
});
@@ -261,7 +264,6 @@ _runTests() {
});
});
-
group('change records', () {
List<ChangeRecord> records;
ObservableMap map;
@@ -269,7 +271,7 @@ _runTests() {
setUp(() {
map = toObservable({'a': 1, 'b': 2});
records = null;
- map.changes.first.then((r) { records = r; });
+ map.changes.first.then((r) => records = r);
});
tearDown(sharedTearDown);
@@ -284,7 +286,7 @@ _runTests() {
expect(map.keys.toList(), ['a', 'b']);
expect(map.values.toList(), [1, 2]);
var copy = {};
- map.forEach((k, v) { copy[k] = v; });
+ map.forEach((k, v) => copy[k] = v);
expect(copy, {'a': 1, 'b': 2});
return new Future(() {
// no change from read-only operators
« no previous file with comments | « packages/observable/test/observable_list_test.dart ('k') | packages/observable/test/observable_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698