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 4627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
4638 const dynamic vIntLong = 44998905507923676709665; | 4638 const dynamic vIntLong = 44998905507923676709665; |
4639 const dynamic vDouble = 2.3; | 4639 const dynamic vDouble = 2.3; |
4640 const dynamic vString = 'abc'; | 4640 const dynamic vString = 'abc'; |
4641 const dynamic vStringConcat = 'aaabbb'; | 4641 const dynamic vStringConcat = 'aaabbb'; |
4642 const dynamic vStringInterpolation = 'aaa ${true} ${42} bbb'; | 4642 const dynamic vStringInterpolation = 'aaa ${true} ${42} bbb'; |
4643 const dynamic vSymbol = #aaa.bbb.ccc; | 4643 const dynamic vSymbol = #aaa.bbb.ccc; |
4644 '''); | 4644 '''); |
4645 } | 4645 } |
4646 } | 4646 } |
4647 | 4647 |
4648 test_const_topLevel_parenthesis() async { | |
Brian Wilkerson
2017/07/19 19:33:15
Should this also test that unnecessary parentheses
| |
4649 var library = await checkLibrary(r''' | |
4650 const int v1 = (1 + 2) * 3; | |
4651 const int v2 = -(1 + 2); | |
4652 const int v3 = ('aaa' + 'bbb').length; | |
4653 '''); | |
4654 checkElementText(library, r''' | |
4655 const int v1 = (1 + 2) * 3; | |
4656 const int v2 = -(1 + 2); | |
4657 const int v3 = ('aaa' + 'bbb'). | |
4658 length/*location: dart:core;String;length?*/; | |
4659 '''); | |
4660 } | |
4661 | |
4648 test_const_topLevel_prefix() async { | 4662 test_const_topLevel_prefix() async { |
4649 var library = await checkLibrary(r''' | 4663 var library = await checkLibrary(r''' |
4650 const vNotEqual = 1 != 2; | 4664 const vNotEqual = 1 != 2; |
4651 const vNot = !true; | 4665 const vNot = !true; |
4652 const vNegate = -1; | 4666 const vNegate = -1; |
4653 const vComplement = ~1; | 4667 const vComplement = ~1; |
4654 '''); | 4668 '''); |
4655 if (isStrongMode) { | 4669 if (isStrongMode) { |
4656 checkElementText(library, r''' | 4670 checkElementText(library, r''' |
4657 const bool vNotEqual = 1 != 2; | 4671 const bool vNotEqual = 1 != 2; |
(...skipping 8487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
13145 fail('Unexpectedly tried to get unlinked summary for $uri'); | 13159 fail('Unexpectedly tried to get unlinked summary for $uri'); |
13146 } | 13160 } |
13147 return serializedUnit; | 13161 return serializedUnit; |
13148 } | 13162 } |
13149 | 13163 |
13150 @override | 13164 @override |
13151 bool hasLibrarySummary(String uri) { | 13165 bool hasLibrarySummary(String uri) { |
13152 return true; | 13166 return true; |
13153 } | 13167 } |
13154 } | 13168 } |
OLD | NEW |