Chromium Code Reviews| Index: tests/utils/recursive_import_test.dart |
| diff --git a/tests/utils/recursive_import_test.dart b/tests/utils/recursive_import_test.dart |
| deleted file mode 100644 |
| index 61c1a30248cb02c9c68ada3144be5ba17bb39cad..0000000000000000000000000000000000000000 |
| --- a/tests/utils/recursive_import_test.dart |
| +++ /dev/null |
| @@ -1,72 +0,0 @@ |
| -// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| -// for details. All rights reserved. Use of this source code is governed by a |
| -// BSD-style license that can be found in the LICENSE file. |
| - |
| -// Test of "recursive" imports using the dart2js compiler API. |
| - |
| -import "package:expect/expect.dart"; |
| -import "package:async_helper/async_helper.dart"; |
| -import 'dart:async'; |
| -import 'dummy_compiler_test.dart'; |
| -import 'package:compiler/compiler.dart'; |
| - |
| -const String RECURSIVE_MAIN = """ |
| -library fisk; |
| -import 'recurse/fisk.dart'; |
| -main() {} |
| -"""; |
| - |
| -main() { |
|
Emily Fortuna
2017/07/17 21:33:49
recursive import seems like it would be useful to
Bob Nystrom
2017/07/17 21:53:49
Resurrected and moved.
|
| - int count = 0; |
| - Future<String> provider(Uri uri) { |
| - String source; |
| - if (uri.path.length > 100) { |
| - // Simulate an OS error. |
| - throw 'Path length exceeded'; |
| - } else if (uri.scheme == "main") { |
| - count++; |
| - source = RECURSIVE_MAIN; |
| - } else if (uri.scheme == "lib") { |
| - source = libProvider(uri); |
| - } else { |
| - return new Future.error("unexpected URI $uri"); |
| - } |
| - return new Future.value(source); |
| - } |
| - |
| - int warningCount = 0; |
| - int errorCount = 0; |
| - void handler(Uri uri, int begin, int end, String message, Diagnostic kind) { |
| - if (uri != null) { |
| - print('$uri:$begin:$end: $kind: $message'); |
| - Expect.equals('main', uri.scheme); |
| - if (kind == Diagnostic.WARNING) { |
| - warningCount++; |
| - } else if (kind == Diagnostic.ERROR) { |
| - errorCount++; |
| - } else { |
| - throw kind; |
| - } |
| - } else { |
| - print('$kind: $message'); |
| - } |
| - } |
| - |
| - asyncStart(); |
| - Future<CompilationResult> result = compile( |
| - new Uri(scheme: 'main'), |
| - new Uri(scheme: 'lib', path: '/'), |
| - new Uri(scheme: 'package', path: '/'), |
| - provider, |
| - handler); |
| - result.then((CompilationResult result) { |
| - Expect.isFalse(result.isSuccess); |
| - Expect.isTrue(10 < count); |
| - // Two warnings for each time RECURSIVE_MAIN is read, except the |
| - // first time. |
| - Expect.equals(2 * (count - 1), warningCount); |
| - Expect.equals(1, errorCount); |
| - }, onError: (e, s) { |
| - throw 'Compilation failed: $e\n$s'; |
| - }).then(asyncSuccess); |
| -} |