Skip to content

Commit 893932d

Browse files
DanTupCommit Queue
authored andcommitted
Remove useLineEndingsForPlatform flag
Nothing ever sets this flag, it was left over from moving tests over to use normalization by default. Fixes #60234 Change-Id: I4a657838f488f73e09c898c89ccb33885d47cf79 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/459481 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com> Reviewed-by: Samuel Rawlins <srawlins@google.com> Commit-Queue: Samuel Rawlins <srawlins@google.com>
1 parent 94ef824 commit 893932d

File tree

3 files changed

+4
-15
lines changed

3 files changed

+4
-15
lines changed

pkg/analysis_server/test/analysis_server_base.dart

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -221,9 +221,6 @@ class PubPackageAnalysisServerTest extends ContextResolutionTest
221221

222222
final String testPackageName = 'test';
223223

224-
/// Whether to automatically normalize line endings for the current platform.
225-
bool useLineEndingsForPlatform = true;
226-
227224
/// Return a list of the experiments that are to be enabled for tests in this
228225
/// class, an empty list if there are no experiments that should be enabled.
229226
List<String> get experiments => experimentsForTests;
@@ -277,9 +274,7 @@ class PubPackageAnalysisServerTest extends ContextResolutionTest
277274

278275
// TODO(scheglov): rename
279276
void addTestFile(String content) {
280-
parsedTestCode = useLineEndingsForPlatform
281-
? TestCode.parseNormalized(content)
282-
: TestCode.parse(content);
277+
parsedTestCode = TestCode.parseNormalized(content);
283278
newFile(testFilePath, parsedTestCode.code);
284279
}
285280

@@ -322,9 +317,7 @@ class PubPackageAnalysisServerTest extends ContextResolutionTest
322317

323318
@override
324319
File newFile(String path, String content) {
325-
if (useLineEndingsForPlatform) {
326-
content = normalizeNewlinesForPlatform(content);
327-
}
320+
content = normalizeNewlinesForPlatform(content);
328321
return super.newFile(path, content);
329322
}
330323

pkg/analysis_server/test/client/completion_driver_test.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,7 @@ abstract class AbstractCompletionDriverTest
7676
@override
7777
@protected
7878
Future<List<CompletionSuggestion>> addTestFile(String content) async {
79-
if (useLineEndingsForPlatform) {
80-
content = normalizeNewlinesForPlatform(content);
81-
}
79+
content = normalizeNewlinesForPlatform(content);
8280
driver.addTestFile(content);
8381

8482
// Wait after adding the test file, this might affect diagnostics.

pkg/analysis_server/test/domain_completion_util.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ class AbstractCompletionDomainTest extends PubPackageAnalysisServerTest {
8383
required String content,
8484
int maxResults = 1 << 10,
8585
}) async {
86-
var code = useLineEndingsForPlatform
87-
? TestCode.parseNormalized(content)
88-
: TestCode.parse(content);
86+
var code = TestCode.parseNormalized(content);
8987
var completionOffset = code.position.offset;
9088

9189
newFile(path, code.code);

0 commit comments

Comments
 (0)