Skip to content

Commit

Permalink
[gardening] Fix analysis options test on Windows.
Browse files Browse the repository at this point in the history
Normalize paths for memory file system infra.

Fixes #59601

Change-Id: I42fd13775d5d1e3ba0a11f505180076bcc58e190
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/397401
Reviewed-by: Konstantin Shcheglov <[email protected]>
Commit-Queue: Alexander Aprelev <[email protected]>
  • Loading branch information
aam authored and Commit Queue committed Nov 25, 2024
1 parent 32565d1 commit 4b2b0a8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/analyzer/test/src/options/analysis_options_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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,
);

Expand Down Expand Up @@ -331,7 +331,7 @@ plugins:
'toYaml',
'''
plugin_one:
path: /project/foo/bar
path: ${resourceProvider.convertPath('/project/foo/bar')}
''',
),
);
Expand All @@ -354,7 +354,7 @@ plugins:
'toYaml',
'''
plugin_one:
path: /foo/baz
path: ${resourceProvider.convertPath('/foo/baz')}
''',
),
);
Expand Down

0 comments on commit 4b2b0a8

Please sign in to comment.