From b541521f8a6d43f02056211cec2520d7287f3de3 Mon Sep 17 00:00:00 2001 From: Leo Farias Date: Tue, 19 Sep 2023 15:21:08 -0400 Subject: [PATCH] Update tests --- .github/workflows/test.yml | 4 ++-- test/commands/flutter_command_test.dart | 14 +++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e10d38f0..fe63e956 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,9 +29,9 @@ jobs: steps: - name: Prepare environment - uses: ./.github/actions/prepare/action.yml + uses: ./.github/actions/prepare with: sdk-version: ${{ github.event.inputs.sdk-version }} - name: Tests - uses: ./.github/actions/test/action.yml + uses: ./.github/actions/test diff --git a/test/commands/flutter_command_test.dart b/test/commands/flutter_command_test.dart index 02c58e8c..ef6f346b 100644 --- a/test/commands/flutter_command_test.dart +++ b/test/commands/flutter_command_test.dart @@ -100,9 +100,13 @@ void main() { versionNumber, ); + final dartVersionOut = dartVersionResult.stdout.toString().isEmpty + ? dartVersionResult.stderr + : dartVersionResult.stdout; + final flutterVersion = extractFlutterVersionOutput(flutterVersionResult.stdout); - final dartVersion = extractDartVersionOutput(dartVersionResult.stderr); + final dartVersion = extractDartVersionOutput(dartVersionOut); expect(dartVersion, cacheVersion.dartSdkVersion); @@ -118,6 +122,14 @@ void main() { final cacheVersion = CacheService.fromContext .getVersion(FlutterVersion.parse(versionNumber)); + final exitCode = await runner.run('fvm exec flutter --version'); + + expect(exitCode, ExitCode.success.code); + + final usageExitCode = await runner.run('fvm exec'); + + expect(usageExitCode, ExitCode.usage.code); + final flutterVersionResult = await execCmd('flutter', ['--version'], cacheVersion); final dartVersionResult =