OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 test.src.watch_manager_test; | 5 library test.src.watch_manager_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/src/watch_manager.dart'; | 9 import 'package:analysis_server/src/watch_manager.dart'; |
10 import 'package:analyzer/file_system/file_system.dart'; | 10 import 'package:analyzer/file_system/file_system.dart'; |
11 import 'package:analyzer/file_system/memory_file_system.dart'; | 11 import 'package:analyzer/file_system/memory_file_system.dart'; |
12 import 'package:test/test.dart'; | 12 import 'package:test/test.dart'; |
13 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 13 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
14 import 'package:watcher/watcher.dart'; | 14 import 'package:watcher/watcher.dart'; |
15 | 15 |
16 import '../mocks.dart'; | 16 import '../mocks.dart'; |
17 import '../utils.dart'; | |
18 | 17 |
19 main() { | 18 main() { |
20 initializeTestEnvironment(); | |
21 defineReflectiveSuite(() { | 19 defineReflectiveSuite(() { |
22 defineReflectiveTests(WatchManagerTest); | 20 defineReflectiveTests(WatchManagerTest); |
23 defineReflectiveTests(WatchNodeTest); | 21 defineReflectiveTests(WatchNodeTest); |
24 }); | 22 }); |
25 } | 23 } |
26 | 24 |
27 /** | 25 /** |
28 * Tokens that can be used for testing purposes. | 26 * Tokens that can be used for testing purposes. |
29 */ | 27 */ |
30 class Token { | 28 class Token { |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 void test_insert_top() { | 343 void test_insert_top() { |
346 WatchNode rootNode = new WatchNode(null); | 344 WatchNode rootNode = new WatchNode(null); |
347 WatchNode topNode = new WatchNode(provider.getFolder('/a/b')); | 345 WatchNode topNode = new WatchNode(provider.getFolder('/a/b')); |
348 | 346 |
349 rootNode.insert(topNode); | 347 rootNode.insert(topNode); |
350 expect(rootNode.children, equals([topNode])); | 348 expect(rootNode.children, equals([topNode])); |
351 expect(topNode.parent, rootNode); | 349 expect(topNode.parent, rootNode); |
352 expect(topNode.children, isEmpty); | 350 expect(topNode.children, isEmpty); |
353 } | 351 } |
354 } | 352 } |
OLD | NEW |