diff --git a/packages/flutter_tools/lib/src/commands/test.dart b/packages/flutter_tools/lib/src/commands/test.dart index e798412bde..aa301ba937 100644 --- a/packages/flutter_tools/lib/src/commands/test.dart +++ b/packages/flutter_tools/lib/src/commands/test.dart @@ -273,7 +273,7 @@ class TestCommand extends FlutterCommand with DeviceBasedDevelopmentArtifacts { if (globals.fs.isDirectorySync(path)) ..._findTests(globals.fs.directory(path)) else - globals.fs.path.absolute(path) + globals.fs.path.normalize(globals.fs.path.absolute(path)) ]; } diff --git a/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart b/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart index 2249fb7f4b..5070661b1c 100644 --- a/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart +++ b/packages/flutter_tools/test/commands.shard/hermetic/test_test.dart @@ -446,6 +446,27 @@ dev_dependencies: ]), }); + testUsingContext('when absolute unnormalized path to integration test is passed', () async { + final FakePackageTest fakePackageTest = FakePackageTest(); + + final TestCommand testCommand = TestCommand(testWrapper: fakePackageTest); + final CommandRunner commandRunner = createTestCommandRunner(testCommand); + + await commandRunner.run(const [ + 'test', + '--no-pub', + '/package/../package/integration_test/some_integration_test.dart', + ]); + + expect(testCommand.isIntegrationTest, true); + }, overrides: { + FileSystem: () => fs, + ProcessManager: () => FakeProcessManager.any(), + DeviceManager: () => _FakeDeviceManager([ + FakeDevice('ephemeral', 'ephemeral', type: PlatformType.android), + ]), + }); + testUsingContext('when both test and integration test are passed', () async { final FakeFlutterTestRunner testRunner = FakeFlutterTestRunner(0);