Skip to content

Commit 57cf6eb

Browse files
Anna Gringauzecommit-bot@chromium.org
Anna Gringauze
authored andcommitted
Enable tests for a fixed issue
#41976 Change-Id: Ia294b421f52a9cccd98198e16fd17d3eff7e9238 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/153941 Reviewed-by: Johnni Winther <[email protected]> Commit-Queue: Anna Gringauze <[email protected]>
1 parent cf57f88 commit 57cf6eb

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

pkg/frontend_server/test/src/expression_compiler_test.dart

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,9 +1129,10 @@ int main() {
11291129
var k = Key('t');
11301130
MyClass c = MyClass(0);
11311131
int p = 1;
1132+
const t = 1;
11321133
11331134
/* evaluation placeholder */
1134-
print('\$c, \$k');
1135+
print('\$c, \$k, \$t');
11351136
}
11361137
''';
11371138

@@ -1158,7 +1159,7 @@ int main() {
11581159
''');
11591160
});
11601161

1161-
test('evaluate const expression', () async {
1162+
test('evaluate new const expression', () async {
11621163
await driver.check(
11631164
scope: <String, String>{'p': '1'},
11641165
expression: 'const MyClass(1)',
@@ -1171,6 +1172,20 @@ int main() {
11711172
''');
11721173
});
11731174

1175+
test('evaluate optimized const expression', () async {
1176+
await driver.check(
1177+
scope: <String, String>{},
1178+
expression: 't',
1179+
expectedResult: '''
1180+
(function() {
1181+
return 1;
1182+
}(
1183+
))
1184+
''');
1185+
},
1186+
skip:
1187+
'Cannot compile constants optimized away by the frontend'); // https://github.com/dart-lang/sdk/issues/41999
1188+
11741189
test('evaluate factory constructor call', () async {
11751190
await driver.check(
11761191
scope: <String, String>{'p': '1'},
@@ -1182,24 +1197,20 @@ int main() {
11821197
1
11831198
))
11841199
''');
1185-
},
1186-
skip:
1187-
'Incorrect kernel for factory constructor call'); // https://github.com/dart-lang/sdk/issues/41976
1200+
});
11881201

11891202
test('evaluate const factory constructor call', () async {
11901203
await driver.check(
11911204
scope: <String, String>{'p': '1'},
11921205
expression: "const Key('t')",
11931206
expectedResult: '''
11941207
(function(p) {
1195-
return dart.const(new foo.ValueKey.new("t"));
1208+
return C0 || CT.C0;
11961209
}(
11971210
1
11981211
))
11991212
''');
1200-
},
1201-
skip:
1202-
'Incorrect kernel for factory constructor call'); // https://github.com/dart-lang/sdk/issues/41976
1213+
});
12031214
});
12041215

12051216
return 0;

0 commit comments

Comments
 (0)