From 4b2b0a84ae393bf5756892ca509c9e1b89054aec Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Mon, 25 Nov 2024 19:14:49 +0000 Subject: [PATCH] [gardening] Fix analysis options test on Windows. Normalize paths for memory file system infra. Fixes https://github.com/dart-lang/sdk/issues/59601 Change-Id: I42fd13775d5d1e3ba0a11f505180076bcc58e190 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397401 Reviewed-by: Konstantin Shcheglov Commit-Queue: Alexander Aprelev --- .../test/src/options/analysis_options_test.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/analyzer/test/src/options/analysis_options_test.dart b/pkg/analyzer/test/src/options/analysis_options_test.dart index e7a6edb00725..072acd746ea9 100644 --- a/pkg/analyzer/test/src/options/analysis_options_test.dart +++ b/pkg/analyzer/test/src/options/analysis_options_test.dart @@ -4,7 +4,6 @@ import 'package:analyzer/dart/analysis/analysis_options.dart'; import 'package:analyzer/error/error.dart'; -import 'package:analyzer/file_system/file_system.dart'; import 'package:analyzer/file_system/memory_file_system.dart'; import 'package:analyzer/src/analysis_options/analysis_options_provider.dart'; import 'package:analyzer/src/dart/analysis/analysis_options.dart'; @@ -24,14 +23,15 @@ main() { class AnalysisOptionsTest { final AnalysisOptionsProvider optionsProvider = AnalysisOptionsProvider(); - final ResourceProvider resourceProvider = MemoryResourceProvider(); + final resourceProvider = MemoryResourceProvider(); // TODO(srawlins): Add tests that exercise // `optionsProvider.getOptionsFromString` throwing an exception. AnalysisOptionsImpl parseOptions(String content) => AnalysisOptionsImpl.fromYaml( optionsMap: optionsProvider.getOptionsFromString(content), - file: resourceProvider.getFile('/project/analysis_options.yaml'), + file: resourceProvider.getFile(resourceProvider.convertPath( + '/project/analysis_options.yaml')), resourceProvider: resourceProvider, ); @@ -331,7 +331,7 @@ plugins: 'toYaml', ''' plugin_one: - path: /project/foo/bar + path: ${resourceProvider.convertPath('/project/foo/bar')} ''', ), ); @@ -354,7 +354,7 @@ plugins: 'toYaml', ''' plugin_one: - path: /foo/baz + path: ${resourceProvider.convertPath('/foo/baz')} ''', ), );