diff --git a/packages/patrol_cli/CHANGELOG.md b/packages/patrol_cli/CHANGELOG.md index b96c200e3..d79ead66e 100644 --- a/packages/patrol_cli/CHANGELOG.md +++ b/packages/patrol_cli/CHANGELOG.md @@ -1,3 +1,7 @@ +## Unreleased + +- Fix bug with `test_bundle.dart` being sometimes garbled on Windows (#1797) + ## 2.2.0 - Add support for `group()` (#1634) diff --git a/packages/patrol_cli/lib/src/test_bundler.dart b/packages/patrol_cli/lib/src/test_bundler.dart index 4b2c489d9..472eb66b9 100644 --- a/packages/patrol_cli/lib/src/test_bundler.dart +++ b/packages/patrol_cli/lib/src/test_bundler.dart @@ -177,7 +177,10 @@ ${generateGroupsCode([testFilePath]).split('\n').map((e) => ' $e').join('\n')} for (final testFilePath in testFilePaths) { final relativeTestFilePath = _normalizeTestPath(testFilePath); final testName = _createTestName(relativeTestFilePath); - imports.add("import '$relativeTestFilePath' as $testName;"); + final relativeTestFilePathWithoutSlash = relativeTestFilePath[0] == '/' + ? relativeTestFilePath.replaceFirst('/', '') + : relativeTestFilePath; + imports.add("import '$relativeTestFilePathWithoutSlash' as $testName;"); } return imports.join('\n');