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
33
33
34
34
static final ByteStore _byteStore = MemoryByteStore ();
35
35
36
- /// Whether to rewrite line endings in test code based on platform.
37
- bool useLineEndingsForPlatform = true ;
38
-
39
36
final Map <String , String > _declaredVariables = {};
40
37
AnalysisContextCollectionImpl ? _analysisContextCollection;
41
38
@@ -203,9 +200,8 @@ class AbstractContextTest
203
200
}
204
201
205
202
/// 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);
209
205
210
206
Future <AnalysisSession > sessionFor (File file) async {
211
207
var analysisContext = _contextFor (file);
Original file line number Diff line number Diff line change @@ -12,15 +12,16 @@ String get testEol =>
12
12
// existing `TEST_ANALYZER_WINDOWS_PATHS` var) to allow testing
13
13
// `\n` on Windows or `\r\n` on non-Windows, to ensure we don't have any
14
14
// 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.
15
17
Platform .lineTerminator;
16
18
17
19
/// Normalizes content to use platform-specific newlines.
18
20
///
19
21
/// This ensures that when running on Windows, '\r\n' is used, even though
20
22
/// source files are checked out using '\n'.
21
23
String 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
24
25
// tests and have them automatically normalized.
25
26
26
27
// Skip normalising for other platforms, as the 'gitattributes' for the Dart
You can’t perform that action at this time.
0 commit comments