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

Unified Diff: tests/compiler/dart2js/constant_expression_evaluate_test.dart

Issue 1166723002: Add StringLengthConstantExpression (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Update .fromEnvironment test expectations. Created 5 years, 7 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/docgen/lib/src/models/model_helpers.dart ('k') | tests/compiler/dart2js/constant_expression_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/constant_expression_evaluate_test.dart
diff --git a/tests/compiler/dart2js/constant_expression_evaluate_test.dart b/tests/compiler/dart2js/constant_expression_evaluate_test.dart
index 2a2c41eefd75caa6ba84b621c7252b8c9040b754..2e8241207981331f8139f189cd290971261f05ca 100644
--- a/tests/compiler/dart2js/constant_expression_evaluate_test.dart
+++ b/tests/compiler/dart2js/constant_expression_evaluate_test.dart
@@ -38,7 +38,8 @@ class MemoryEnvironment implements Environment {
final Compiler compiler;
final Map<String, String> env;
- MemoryEnvironment(this.compiler, [this.env = const <String, String>{}]);
+ MemoryEnvironment(this.compiler,
+ [this.env = const <String, String>{}]);
@override
String readFromEnvironment(String name) => env[name];
@@ -54,6 +55,7 @@ const List<TestData> DATA = const [
const ConstantData('"foo"', const { const {} : 'StringConstant("foo")' }),
const ConstantData('1 + 2', const { const {} : 'IntConstant(3)' }),
const ConstantData('-(1)', const { const {} : 'IntConstant(-1)' }),
+ const ConstantData('"foo".length', const { const {} : 'IntConstant(3)' }),
const ConstantData('identical(0, 1)',
const { const {} : 'BoolConstant(false)' }),
const ConstantData('"a" "b"', const { const {} : 'StringConstant("ab")' }),
@@ -144,9 +146,7 @@ class A<T> implements B {
}
class B<S> implements C {
const factory B({field1}) = A<B<S>>;
- // TODO(johnniwinther): Enable this when the constructor evaluator doesn't
- // crash:
- /*const factory B.named() = A<S>;*/
+ const factory B.named() = A<S>;
}
class C<U> {
const factory C({field1}) = A<B<double>>;
@@ -170,11 +170,9 @@ class C<U> {
const ConstantData('const C<int>(field1: 87)',
const { const {} :
'ConstructedConstant(A<B<double>>(field1=IntConstant(87)))' }),
- // TODO(johnniwinther): Enable this when the constructor evaluator doesn't
- // crash:
- /*const ConstantData('const B<int>.named()',
+ const ConstantData('const B<int>.named()',
const { const {} :
- 'ConstructedConstant(A<int>(field1=IntConstant(42)))' }),*/
+ 'ConstructedConstant(A<int>(field1=IntConstant(42)))' }),
]),
const TestData('''
const c = const int.fromEnvironment("foo", defaultValue: 5);
« no previous file with comments | « pkg/docgen/lib/src/models/model_helpers.dart ('k') | tests/compiler/dart2js/constant_expression_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698