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.serialization.elements_test; | 5 library test.src.serialization.elements_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analyzer/dart/ast/ast.dart'; | 9 import 'package:analyzer/dart/ast/ast.dart'; |
10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; | 10 import 'package:analyzer/dart/ast/standard_resolution_map.dart'; |
(...skipping 2095 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2106 class C { | 2106 class C { |
2107 C.foo(); | 2107 C.foo(); |
2108 C.bar(); | 2108 C.bar(); |
2109 } | 2109 } |
2110 '''); | 2110 '''); |
2111 } | 2111 } |
2112 } | 2112 } |
2113 | 2113 |
2114 test_class_documented() async { | 2114 test_class_documented() async { |
2115 var library = await checkLibrary(''' | 2115 var library = await checkLibrary(''' |
2116 // Extra comment so doc comment offset != 0 | |
2117 /** | 2116 /** |
2118 * Docs | 2117 * Docs |
2119 */ | 2118 */ |
2120 class C {}'''); | 2119 class C {}'''); |
2121 if (isStrongMode) { | 2120 checkElementText(library, r''' |
2122 checkElementText(library, r''' | |
2123 /** | 2121 /** |
2124 * Docs | 2122 * Docs |
2125 */ | 2123 */ |
2126 class C { | 2124 class C { |
2127 } | 2125 } |
2128 '''); | 2126 '''); |
2129 } else { | |
2130 checkElementText(library, r''' | |
2131 /** | |
2132 * Docs | |
2133 */ | |
2134 class C { | |
2135 } | |
2136 '''); | |
2137 } | |
2138 } | 2127 } |
2139 | 2128 |
2140 test_class_documented_tripleSlash() async { | 2129 test_class_documented_tripleSlash() async { |
2141 var library = await checkLibrary(''' | 2130 var library = await checkLibrary(''' |
2142 /// aaa | 2131 /// aaa |
2143 /// bbbb | 2132 /// bbbb |
2144 /// cc | 2133 /// cc |
2145 class C {}'''); | 2134 class C {}'''); |
2146 if (isStrongMode) { | 2135 if (isStrongMode) { |
2147 checkElementText(library, r''' | 2136 checkElementText(library, r''' |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2212 checkElementText(library, r''' | 2201 checkElementText(library, r''' |
2213 /** | 2202 /** |
2214 * Docs | 2203 * Docs |
2215 */ | 2204 */ |
2216 class C { | 2205 class C { |
2217 } | 2206 } |
2218 '''); | 2207 '''); |
2219 } | 2208 } |
2220 } | 2209 } |
2221 | 2210 |
| 2211 test_class_documented_withLeadingNotDocumentation() async { |
| 2212 var library = await checkLibrary(''' |
| 2213 // Extra comment so doc comment offset != 0 |
| 2214 /** |
| 2215 * Docs |
| 2216 */ |
| 2217 class C {}'''); |
| 2218 checkElementText(library, r''' |
| 2219 /** |
| 2220 * Docs |
| 2221 */ |
| 2222 class C { |
| 2223 } |
| 2224 '''); |
| 2225 } |
| 2226 |
2222 test_class_field_const() async { | 2227 test_class_field_const() async { |
2223 var library = await checkLibrary('class C { static const int i = 0; }'); | 2228 var library = await checkLibrary('class C { static const int i = 0; }'); |
2224 if (isStrongMode) { | 2229 if (isStrongMode) { |
2225 checkElementText(library, r''' | 2230 checkElementText(library, r''' |
2226 class C { | 2231 class C { |
2227 static const int i = 0; | 2232 static const int i = 0; |
2228 } | 2233 } |
2229 '''); | 2234 '''); |
2230 } else { | 2235 } else { |
2231 checkElementText(library, r''' | 2236 checkElementText(library, r''' |
(...skipping 10881 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13113 fail('Unexpectedly tried to get unlinked summary for $uri'); | 13118 fail('Unexpectedly tried to get unlinked summary for $uri'); |
13114 } | 13119 } |
13115 return serializedUnit; | 13120 return serializedUnit; |
13116 } | 13121 } |
13117 | 13122 |
13118 @override | 13123 @override |
13119 bool hasLibrarySummary(String uri) { | 13124 bool hasLibrarySummary(String uri) { |
13120 return true; | 13125 return true; |
13121 } | 13126 } |
13122 } | 13127 } |
OLD | NEW |