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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1174763002: Use ConstantVerifier in VerifyUnitTask. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/task/dart.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/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index f89b77194b0dbd1f0bda72b66199eaa8cc5700d8..7c02e2c9b12792856b10fd20e710031d944aaa00 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -2627,6 +2627,22 @@ class ScanDartTaskTest extends _AbstractDartTaskTest {
@reflectiveTest
class VerifyUnitTaskTest extends _AbstractDartTaskTest {
+ test_perform_constantError() {
+ Source source = newSource('/test.dart', '''
+main(int p) {
+ const v = p;
+}
+''');
+ LibrarySpecificUnit target = new LibrarySpecificUnit(source, source);
+ _computeResult(target, VERIFY_ERRORS);
+ expect(task, new isInstanceOf<VerifyUnitTask>());
+ // validate
+ _fillErrorListener(VERIFY_ERRORS);
+ errorListener.assertErrorsWithCodes(<ErrorCode>[
+ CompileTimeErrorCode.CONST_INITIALIZED_WITH_NON_CONSTANT_VALUE
+ ]);
+ }
+
test_perform_directiveError() {
Source source = newSource('/test.dart', '''
import 'no-such-file.dart';
« no previous file with comments | « pkg/analyzer/lib/src/task/dart.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698