File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
analyzer/lib/src/test_utilities Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,6 @@ class AbstractContextTest
3333
3434 static final ByteStore _byteStore = MemoryByteStore ();
3535
36- /// Whether to rewrite line endings in test code based on platform.
37- bool useLineEndingsForPlatform = true ;
38-
3936 final Map <String , String > _declaredVariables = {};
4037 AnalysisContextCollectionImpl ? _analysisContextCollection;
4138
@@ -203,9 +200,8 @@ class AbstractContextTest
203200 }
204201
205202 /// Convenience function to normalize newlines in [code] for the current
206- /// platform if [useLineEndingsForPlatform] is `true` .
207- String normalizeSource (String code) =>
208- useLineEndingsForPlatform ? normalizeNewlinesForPlatform (code) : code;
203+ /// platform.
204+ String normalizeSource (String code) => normalizeNewlinesForPlatform (code);
209205
210206 Future <AnalysisSession > sessionFor (File file) async {
211207 var analysisContext = _contextFor (file);
Original file line number Diff line number Diff line change @@ -12,15 +12,16 @@ String get testEol =>
1212 // existing `TEST_ANALYZER_WINDOWS_PATHS` var) to allow testing
1313 // `\n` on Windows or `\r\n` on non-Windows, to ensure we don't have any
1414 // code just assuming the platform EOL (instead of the files EOL).
15+ // [normalizeNewlinesForPlatform] may need updating to not assume it only
16+ // needs to run for Windows.
1517 Platform .lineTerminator;
1618
1719/// Normalizes content to use platform-specific newlines.
1820///
1921/// This ensures that when running on Windows, '\r\n' is used, even though
2022/// source files are checked out using '\n'.
2123String normalizeNewlinesForPlatform (String input) {
22- // TODO(dantup): Once all instances of useLineEndingsForPlatform have been
23- // removed, we should try to minimize the number of explicit calls here from
24+ // TODO(dantup): Try to minimize the number of explicit calls here from
2425 // tests and have them automatically normalized.
2526
2627 // Skip normalising for other platforms, as the 'gitattributes' for the Dart
You can’t perform that action at this time.
0 commit comments