OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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.analysis.notification.navigation; | 5 library test.analysis.notification.navigation; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/src/constants.dart'; | 9 import 'package:analysis_server/src/constants.dart'; |
10 import 'package:analysis_server/src/protocol.dart'; | 10 import 'package:analysis_server/src/protocol.dart'; |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 assertHasOperatorRegion('] += 2;', 1, '[]=(index,', 3); | 657 assertHasOperatorRegion('] += 2;', 1, '[]=(index,', 3); |
658 assertHasOperatorRegion('+= 2;', 2, '+(other)', 1); | 658 assertHasOperatorRegion('+= 2;', 2, '+(other)', 1); |
659 }); | 659 }); |
660 } | 660 } |
661 | 661 |
662 test_partOf() { | 662 test_partOf() { |
663 var libCode = 'library lib; part "test.dart";'; | 663 var libCode = 'library lib; part "test.dart";'; |
664 var libFile = addFile('$projectPath/bin/lib.dart', libCode); | 664 var libFile = addFile('$projectPath/bin/lib.dart', libCode); |
665 addTestFile('part of lib;'); | 665 addTestFile('part of lib;'); |
666 return prepareNavigation().then((_) { | 666 return prepareNavigation().then((_) { |
667 assertHasRegionString('part of lib'); | 667 assertHasRegionString('lib'); |
668 assertHasFileTarget(libFile, libCode.indexOf('lib;'), 'lib'.length); | 668 assertHasFileTarget(libFile, libCode.indexOf('lib;'), 'lib'.length); |
669 }); | 669 }); |
670 } | 670 } |
671 | 671 |
672 test_string_export() { | 672 test_string_export() { |
673 var libCode = 'library lib;'; | 673 var libCode = 'library lib;'; |
674 var libFile = addFile('$projectPath/bin/lib.dart', libCode); | 674 var libFile = addFile('$projectPath/bin/lib.dart', libCode); |
675 addTestFile('export "lib.dart";'); | 675 addTestFile('export "lib.dart";'); |
676 return prepareNavigation().then((_) { | 676 return prepareNavigation().then((_) { |
677 assertHasRegionString('"lib.dart"'); | 677 assertHasRegionString('"lib.dart"'); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
799 test_type_void() { | 799 test_type_void() { |
800 addTestFile(''' | 800 addTestFile(''' |
801 void main() { | 801 void main() { |
802 } | 802 } |
803 '''); | 803 '''); |
804 return prepareNavigation().then((_) { | 804 return prepareNavigation().then((_) { |
805 assertNoRegionAt('void'); | 805 assertNoRegionAt('void'); |
806 }); | 806 }); |
807 } | 807 } |
808 } | 808 } |
OLD | NEW |