| 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 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 'package:observe/src/path_observer.dart' | 8 import 'package:observe/src/path_observer.dart' |
| 9 show getSegmentsOfPropertyPathForTesting, | 9 show getSegmentsOfPropertyPathForTesting, |
| 10 observerSentinelForTesting; | 10 observerSentinelForTesting; |
| 11 | 11 |
| 12 import 'observe_test_utils.dart'; | 12 import 'observe_test_utils.dart'; |
| 13 | 13 |
| 14 import 'package:observe/mirrors_used.dart'; // make test smaller. |
| 15 import 'package:smoke/mirrors.dart'; |
| 16 |
| 14 // This file contains code ported from: | 17 // This file contains code ported from: |
| 15 // https://github.com/rafaelw/ChangeSummary/blob/master/tests/test.js | 18 // https://github.com/rafaelw/ChangeSummary/blob/master/tests/test.js |
| 16 // Dart note: getting invalid properties is an error, unlike in JS where it | 19 // Dart note: getting invalid properties is an error, unlike in JS where it |
| 17 // returns undefined. This difference comes up where we check for _throwsNSM in | 20 // returns undefined. This difference comes up where we check for _throwsNSM in |
| 18 // the tests below. | 21 // the tests below. |
| 19 main() => dirtyCheckZone().run(() { | 22 main() => dirtyCheckZone().run(() { |
| 23 useMirrors(); |
| 24 |
| 20 group('PathObserver', observePathTests); | 25 group('PathObserver', observePathTests); |
| 21 | 26 |
| 22 group('PropertyPath', () { | 27 group('PropertyPath', () { |
| 23 test('toString length', () { | 28 test('toString length', () { |
| 24 expectPath(p, str, len, [keys]) { | 29 expectPath(p, str, len, [keys]) { |
| 25 var path = new PropertyPath(p); | 30 var path = new PropertyPath(p); |
| 26 expect(path.toString(), str); | 31 expect(path.toString(), str); |
| 27 expect(path.length, len, reason: 'expected path length $len for $path'); | 32 expect(path.length, len, reason: 'expected path length $len for $path'); |
| 28 if (keys == null) { | 33 if (keys == null) { |
| 29 expect(path.isValid, isFalse); | 34 expect(path.isValid, isFalse); |
| (...skipping 707 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 737 @observable var c; | 742 @observable var c; |
| 738 | 743 |
| 739 WatcherModel(); | 744 WatcherModel(); |
| 740 } | 745 } |
| 741 | 746 |
| 742 class Foo { | 747 class Foo { |
| 743 var value; | 748 var value; |
| 744 Foo(this.value); | 749 Foo(this.value); |
| 745 String toString() => 'Foo$value'; | 750 String toString() => 'Foo$value'; |
| 746 } | 751 } |
| OLD | NEW |