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 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/constant/value.dart'; | 8 import 'package:analyzer/dart/constant/value.dart'; |
9 import 'package:analyzer/dart/element/element.dart'; | 9 import 'package:analyzer/dart/element/element.dart'; |
10 import 'package:analyzer/dart/element/type.dart'; | 10 import 'package:analyzer/dart/element/type.dart'; |
(...skipping 2285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2296 const vConditional = (1 == 2) ? 11 : 22; | 2296 const vConditional = (1 == 2) ? 11 : 22; |
2297 '''); | 2297 '''); |
2298 } | 2298 } |
2299 | 2299 |
2300 test_const_topLevel_identical() { | 2300 test_const_topLevel_identical() { |
2301 checkLibrary(r''' | 2301 checkLibrary(r''' |
2302 const vIdentical = (1 == 2) ? 11 : 22; | 2302 const vIdentical = (1 == 2) ? 11 : 22; |
2303 '''); | 2303 '''); |
2304 } | 2304 } |
2305 | 2305 |
2306 test_const_topLevel_ifNull() { | |
2307 checkLibrary(r''' | |
2308 const vIfNull = 1 ? 2.0; | |
scheglov
2016/11/22 17:51:37
`1 ?? 2.0`
Paul Berry
2016/11/22 18:02:58
Thank you! Fixed.
I'm surprised this didn't lead
| |
2309 '''); | |
2310 } | |
2311 | |
2306 test_const_topLevel_literal() { | 2312 test_const_topLevel_literal() { |
2307 checkLibrary(r''' | 2313 checkLibrary(r''' |
2308 const vNull = null; | 2314 const vNull = null; |
2309 const vBoolFalse = false; | 2315 const vBoolFalse = false; |
2310 const vBoolTrue = true; | 2316 const vBoolTrue = true; |
2311 const vInt = 1; | 2317 const vInt = 1; |
2312 const vIntLong = 0x9876543210987654321; | 2318 const vIntLong = 0x9876543210987654321; |
2313 const vDouble = 2.3; | 2319 const vDouble = 2.3; |
2314 const vString = 'abc'; | 2320 const vString = 'abc'; |
2315 const vStringConcat = 'aaa' 'bbb'; | 2321 const vStringConcat = 'aaa' 'bbb'; |
(...skipping 2426 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4742 fail('Unexpectedly tried to get unlinked summary for $uri'); | 4748 fail('Unexpectedly tried to get unlinked summary for $uri'); |
4743 } | 4749 } |
4744 return serializedUnit; | 4750 return serializedUnit; |
4745 } | 4751 } |
4746 | 4752 |
4747 @override | 4753 @override |
4748 bool hasLibrarySummary(String uri) { | 4754 bool hasLibrarySummary(String uri) { |
4749 return true; | 4755 return true; |
4750 } | 4756 } |
4751 } | 4757 } |
OLD | NEW |