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

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

Issue 1945183002: Fix missing functionality with --allow-native-extensions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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/compiler/lib/src/native/native.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/analyze_only_test.dart
diff --git a/tests/compiler/dart2js/analyze_only_test.dart b/tests/compiler/dart2js/analyze_only_test.dart
index 2d771fb53491534f8d476e7f3790e1898f477f68..e0a9948f64e7b50379f2af3fb23c37a44e69f46c 100644
--- a/tests/compiler/dart2js/analyze_only_test.dart
+++ b/tests/compiler/dart2js/analyze_only_test.dart
@@ -12,8 +12,8 @@ import "package:async_helper/async_helper.dart";
import '../../utils/dummy_compiler_test.dart' as dummy;
import 'package:compiler/compiler.dart';
import 'package:compiler/src/commandline_options.dart';
-import 'package:compiler/src/diagnostics/messages.dart' show
- MessageKind, MessageTemplate;
+import 'package:compiler/src/diagnostics/messages.dart'
+ show MessageKind, MessageTemplate;
import 'output_collector.dart';
@@ -175,12 +175,31 @@ main() {
});
// --analyze-signatures-only implies --analyze-only
+ runCompiler("", [Flags.analyzeSignaturesOnly, Flags.analyzeAll],
+ (String code, List errors, List warnings) {
+ Expect.isNull(code);
+ Expect.isTrue(errors.isEmpty);
+ Expect.isTrue(warnings.isEmpty);
+ });
+
+ // Test that --allow-native-extensions works.
runCompiler(
- "",
- [Flags.analyzeSignaturesOnly, Flags.analyzeAll],
- (String code, List errors, List warnings) {
- Expect.isNull(code);
- Expect.isTrue(errors.isEmpty);
- Expect.isTrue(warnings.isEmpty);
- });
+ """main() {}
+ foo() native 'foo';""",
+ [Flags.analyzeOnly, Flags.allowNativeExtensions],
+ (String code, List errors, List warnings) {
+ Expect.isNull(code);
+ Expect.isTrue(errors.isEmpty);
+ Expect.isTrue(warnings.isEmpty);
+ });
+ runCompiler(
+ """main() {}
+ foo() native 'foo';""",
+ [Flags.analyzeOnly],
+ (String code, List errors, List warnings) {
+ Expect.isNull(code);
+ Expect.isTrue(
+ errors.single.startsWith("'native' modifier is not supported."));
+ Expect.isTrue(warnings.isEmpty);
+ });
}
« no previous file with comments | « pkg/compiler/lib/src/native/native.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698