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

Unified Diff: pkg/analyzer_cli/test/analysis_options_test.dart

Issue 2719703005: fix dartanalyzer find options in bazel workspace (Closed)
Patch Set: merge Created 3 years, 10 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_cli/lib/src/driver.dart ('k') | pkg/analyzer_cli/test/data/bazel/WORKSPACE » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer_cli/test/analysis_options_test.dart
diff --git a/pkg/analyzer_cli/test/analysis_options_test.dart b/pkg/analyzer_cli/test/analysis_options_test.dart
index 5efb26a72a3f80d4f79363ef3b0bc98d79fb263a..ba6535f2df5226e8a48aabf94abb24a0268293ce 100644
--- a/pkg/analyzer_cli/test/analysis_options_test.dart
+++ b/pkg/analyzer_cli/test/analysis_options_test.dart
@@ -7,13 +7,12 @@ import 'package:path/path.dart' as path;
import 'package:test/test.dart';
import 'package:test_reflective_loader/test_reflective_loader.dart';
-import 'utils.dart' show testDirectory, withTempDir;
+import 'utils.dart' show recursiveCopy, testDirectory, withTempDirAsync;
main() {
defineReflectiveTests(OptionsTest);
}
-
@reflectiveTest
class OptionsTest {
_Runner runner;
@@ -28,23 +27,13 @@ class OptionsTest {
}
test_options() async {
- Future<Null> copy(FileSystemEntity src, String dstPath) async {
- if (src is Directory) {
- await (new Directory(dstPath)).create(recursive: true);
- for (FileSystemEntity entity in src.listSync()) {
- await copy(entity, path.join(dstPath, path.basename(entity.path)));
- }
- } else if (src is File) {
- await src.copy(dstPath);
- }
- }
-
// Copy to temp dir so that existing analysis options
// in the test directory hierarchy do not interfere
var projDir = path.join(testDirectory, 'data', 'flutter_analysis_options');
- await withTempDir((String tempDirPath) async {
- await copy(new Directory(projDir), tempDirPath);
- var expectedPath = path.join(tempDirPath, 'somepkgs', 'flutter', 'lib', 'analysis_options_user.yaml');
+ await withTempDirAsync((String tempDirPath) async {
+ await recursiveCopy(new Directory(projDir), tempDirPath);
+ var expectedPath = path.join(tempDirPath, 'somepkgs', 'flutter', 'lib',
+ 'analysis_options_user.yaml');
expect(FileSystemEntity.isFileSync(expectedPath), isTrue);
await runner.run2([
"--packages",
« no previous file with comments | « pkg/analyzer_cli/lib/src/driver.dart ('k') | pkg/analyzer_cli/test/data/bazel/WORKSPACE » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698