Skip to content

Commit 8aa63bb

Browse files
DanTupCommit Queue
authored andcommitted
[dartdev] Fix expected EOLs in some tests to prevent Windows failures
Not sure why these tests seemed to have only recently started failing, because `print` is documented as using `\r\n` on Windows so it seems like these should have always failed. Fixes #61227 Change-Id: Ib5018394186583ae37fc17b51ec5ce4d25617494 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/443300 Commit-Queue: Ben Konyi <[email protected]> Reviewed-by: Ben Konyi <[email protected]> Reviewed-by: Liam Appelbe <[email protected]> Auto-Submit: Danny Tuppeny <[email protected]>
1 parent 1b67001 commit 8aa63bb

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

pkg/dartdev/test/commands/run_test.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ void main() {
5555
}
5656
''';
5757

58+
/// The expected EOL from [print] statements.
59+
final eol = Platform.lineTerminator;
60+
5861
void Function(String) onVmServicesData(
5962
TestProject p, {
6063
bool expectDevtoolsMsg = true,
@@ -232,7 +235,7 @@ void run() {
232235
]);
233236

234237
// --enable-experiment and main.dart should not be passed.
235-
expect(result.stdout, equals('[argument1, argument2]\n'));
238+
expect(result.stdout, equals('[argument1, argument2]$eol'));
236239
expect(result.stderr, isEmpty);
237240
expect(result.exitCode, 0);
238241
});
@@ -281,7 +284,7 @@ void main(List<String> args) => print("$b $args");
281284

282285
// --enable-experiment and main.dart should not be passed.
283286
expect(result.stderr, isEmpty);
284-
expect(result.stdout, equals('[--argument1, argument2]\n'));
287+
expect(result.stdout, equals('[--argument1, argument2]$eol'));
285288
expect(result.exitCode, 0);
286289
});
287290

@@ -299,7 +302,7 @@ void main(List<String> args) => print("$b $args");
299302

300303
// --enable-experiment and main.dart should not be passed.
301304
expect(result.stderr, isEmpty);
302-
expect(result.stdout, equals('[--argument1, argument2]\n'));
305+
expect(result.stdout, equals('[--argument1, argument2]$eol'));
303306
expect(result.exitCode, 0);
304307
});
305308

@@ -661,25 +664,25 @@ main() => print('b:b');
661664
.run(['run', 'a'], workingDir: path.join(p.dirPath, 'pkgs', 'a')),
662665
isA<ProcessResult>()
663666
.having((r) => r.exitCode, 'exitCode', 0)
664-
.having((r) => r.stdout, 'stdout', 'a:a\n'));
667+
.having((r) => r.stdout, 'stdout', 'a:a$eol'));
665668
expect(
666669
await p
667670
.run(['run', 'a:a'], workingDir: path.join(p.dirPath, 'pkgs', 'a')),
668671
isA<ProcessResult>()
669672
.having((r) => r.exitCode, 'exitCode', 0)
670-
.having((r) => r.stdout, 'stdout', 'a:a\n'));
673+
.having((r) => r.stdout, 'stdout', 'a:a$eol'));
671674
expect(
672675
await p.run(['run', ':tool'],
673676
workingDir: path.join(p.dirPath, 'pkgs', 'a')),
674677
isA<ProcessResult>()
675678
.having((r) => r.exitCode, 'exitCode', 0)
676-
.having((r) => r.stdout, 'stdout', 'a:tool\n'));
679+
.having((r) => r.stdout, 'stdout', 'a:tool$eol'));
677680
expect(
678681
await p
679682
.run(['run', 'b'], workingDir: path.join(p.dirPath, 'pkgs', 'a')),
680683
isA<ProcessResult>()
681684
.having((r) => r.exitCode, 'exitCode', 0)
682-
.having((r) => r.stdout, 'stdout', 'b:b\n'));
685+
.having((r) => r.stdout, 'stdout', 'b:b$eol'));
683686
});
684687

685688
group('DDS', () {

0 commit comments

Comments
 (0)