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

Unified Diff: pkg/analyzer/test/generated/non_error_resolver_test.dart

Issue 3003363002: Report compile time errors when assert initializers fail. (Closed)
Patch Set: Created 3 years, 4 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/test/generated/compile_time_error_code_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/generated/non_error_resolver_test.dart
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index c518a0e27fbff20afcb2e10f579c7cf1f8dace60..fae2d4f26bbf0ffcf2bf908212526f0ce9f87d55 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -1456,6 +1456,34 @@ foo() {}''');
verify([source]);
}
+ test_constEvalThrowsException_assertInitializer_notConst() async {
+ resetWith(
+ options: new AnalysisOptionsImpl()..enableAssertInitializer = true);
+ Source source = addSource(r'''
+class A {
+ A(int p) : assert(p != 0);
+}
+var a = new A(0);
+''');
+ await computeAnalysisResult(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
+ test_constEvalThrowsException_assertInitializer_true() async {
+ resetWith(
+ options: new AnalysisOptionsImpl()..enableAssertInitializer = true);
+ Source source = addSource(r'''
+class A {
+ const A(int p) : assert(p != 0);
+}
+const a = const A(1);
+''');
+ await computeAnalysisResult(source);
+ assertNoErrors(source);
+ verify([source]);
+ }
+
test_constEvalTypeBoolNumString_equal() async {
Source source = addSource(r'''
class A {
« no previous file with comments | « pkg/analyzer/test/generated/compile_time_error_code_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698