Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(24)

Unified Diff: pkg/analyzer/test/src/summary/resynthesize_test.dart

Issue 1649873002: Resynthesize binary and prefix expressions. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/tool/summary/idl.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/summary/resynthesize_test.dart
diff --git a/pkg/analyzer/test/src/summary/resynthesize_test.dart b/pkg/analyzer/test/src/summary/resynthesize_test.dart
index 0695bc2781d510ef5674f5ce575b870ebee33ad2..3038400625543de1ff034047aa17cb06654c76c9 100644
--- a/pkg/analyzer/test/src/summary/resynthesize_test.dart
+++ b/pkg/analyzer/test/src/summary/resynthesize_test.dart
@@ -229,7 +229,8 @@ class ResynthTest extends ResolverTestCase {
expect(resynthesized.toStringValue(), original.toStringValue(),
reason: desc);
} else if (original.toSymbolValue() != null) {
- fail('Not implemented');
+ expect(resynthesized.toSymbolValue(), original.toSymbolValue(),
+ reason: desc);
} else if (original.toTypeValue() != null) {
fail('Not implemented');
}
@@ -952,6 +953,44 @@ class E {}''');
checkLibrary('class C {} class D {}');
}
+ test_const_topLevel_binary() {
+ shouldCompareConstValues = true;
+ checkLibrary(r'''
+const vEqual = 1 == 2;
+const vAnd = true && false;
+const vOr = false || true;
+const vBitXor = 1 ^ 2;
+const vBitAnd = 1 & 2;
+const vBitOr = 1 | 2;
+const vBitShiftLeft = 1 << 2;
+const vBitShiftRight = 1 >> 2;
+const vAdd = 1 + 2;
+const vSubtract = 1 - 2;
+const vMiltiply = 1 * 2;
+const vDivide = 1 / 2;
+const vFloorDivide = 1 ~/ 2;
+const vModulo = 1 % 2;
+const vGreater = 1 > 2;
+const vGreaterEqual = 1 >= 2;
+const vLess = 1 < 2;
+const vLessEqual = 1 <= 2;
+''');
+ }
+
+ test_const_topLevel_conditional() {
+ shouldCompareConstValues = true;
+ checkLibrary(r'''
+const vConditional = (1 == 2) ? 11 : 22;
+''');
+ }
+
+ test_const_topLevel_identical() {
+ shouldCompareConstValues = true;
+ checkLibrary(r'''
+const vIdentical = (1 == 2) ? 11 : 22;
+''');
+ }
+
test_const_topLevel_literal() {
shouldCompareConstValues = true;
checkLibrary(r'''
@@ -959,10 +998,22 @@ const vNull = null;
const vBoolFalse = false;
const vBoolTrue = true;
const vInt = 1;
+const vIntLong = 0x9876543210987654321;
const vDouble = 2.3;
const vString = 'abc';
const vStringConcat = 'aaa' 'bbb';
const vStringInterpolation = 'aaa ${true} ${42} bbb';
+const vSymbol = #aaa.bbb.ccc;
+''');
+ }
+
+ test_const_topLevel_unary() {
+ shouldCompareConstValues = true;
+ checkLibrary(r'''
+const vNotEqual = 1 != 2;
+const vNot = !true;
+const vNegate = -1;
+const vComplement = ~1;
''');
}
« no previous file with comments | « pkg/analyzer/lib/src/summary/resynthesize.dart ('k') | pkg/analyzer/tool/summary/idl.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698