[pkv/vm] Add package config to `--depfile` test fix 2
Depfiles escape backslashes with backslashes to be able to encode
spaces in paths. And they have backslashes on windows and forward
slashes on the other platforms.
Change the test to only check for the directory and file names, not
the path separators.
TEST=pkg/vm/test/kernel_front_end_test.dart
Change-Id: I15927d036fa07fe0a03a6d2340a241453f777794
Cq-Include-Trybots: luci.dart.try:pkg-win-release-try,pkg-win-release-arm64-try
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/398901
Reviewed-by: Derek Xu <derekx@google.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
diff --git a/pkg/vm/test/kernel_front_end_test.dart b/pkg/vm/test/kernel_front_end_test.dart
index dce63f02..d1802c8 100644
--- a/pkg/vm/test/kernel_front_end_test.dart
+++ b/pkg/vm/test/kernel_front_end_test.dart
@@ -184,7 +184,11 @@
]);
expect(
File(outputDepfile()).readAsStringSync(),
- stringContainsInOrder('$sdkDir/$packageConfigFile'.split('/')),
+ stringContainsInOrder(
+ // Don't check for any path separators to avoid having to deal with
+ // different slashes and back-slash escaping.
+ '$sdkDir/$packageConfigFile'.replaceAll(r'\', '/').split('/'),
+ ),
);
},
timeout: Timeout.none,