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/plugin/protocol/protocol.dart'; | 9 import 'package:analysis_server/plugin/protocol/protocol.dart'; |
10 import 'package:analysis_server/src/constants.dart'; | 10 import 'package:analysis_server/src/constants.dart'; |
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
770 operator []=(index, A value) {} | 770 operator []=(index, A value) {} |
771 } | 771 } |
772 main() { | 772 main() { |
773 var b = new B(); | 773 var b = new B(); |
774 b[0] // []; | 774 b[0] // []; |
775 b[1] = 1; // []=; | 775 b[1] = 1; // []=; |
776 b[2] += 2; | 776 b[2] += 2; |
777 } | 777 } |
778 '''); | 778 '''); |
779 return prepareNavigation().then((_) { | 779 return prepareNavigation().then((_) { |
| 780 assertHasOperatorRegion('[0', 1, '[](index)', 2); |
780 assertHasOperatorRegion('] // []', 1, '[](index)', 2); | 781 assertHasOperatorRegion('] // []', 1, '[](index)', 2); |
| 782 assertHasOperatorRegion('[1', 1, '[]=(index,', 3); |
781 assertHasOperatorRegion('] = 1;', 1, '[]=(index,', 3); | 783 assertHasOperatorRegion('] = 1;', 1, '[]=(index,', 3); |
| 784 assertHasOperatorRegion('[2', 1, '[]=(index,', 3); |
782 assertHasOperatorRegion('] += 2;', 1, '[]=(index,', 3); | 785 assertHasOperatorRegion('] += 2;', 1, '[]=(index,', 3); |
783 assertHasOperatorRegion('+= 2;', 2, '+(other)', 1); | 786 assertHasOperatorRegion('+= 2;', 2, '+(other)', 1); |
784 }); | 787 }); |
785 } | 788 } |
786 | 789 |
787 test_partOf() { | 790 test_partOf() { |
788 var libCode = 'library lib; part "test.dart";'; | 791 var libCode = 'library lib; part "test.dart";'; |
789 var libFile = addFile('$projectPath/bin/lib.dart', libCode); | 792 var libFile = addFile('$projectPath/bin/lib.dart', libCode); |
790 addTestFile('part of lib;'); | 793 addTestFile('part of lib;'); |
791 return prepareNavigation().then((_) { | 794 return prepareNavigation().then((_) { |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
924 test_type_void() { | 927 test_type_void() { |
925 addTestFile(''' | 928 addTestFile(''' |
926 void main() { | 929 void main() { |
927 } | 930 } |
928 '''); | 931 '''); |
929 return prepareNavigation().then((_) { | 932 return prepareNavigation().then((_) { |
930 assertNoRegionAt('void'); | 933 assertNoRegionAt('void'); |
931 }); | 934 }); |
932 } | 935 } |
933 } | 936 } |
OLD | NEW |