Skip to content

Commit 10373c3

Browse files
dcharkesCommit Queue
authored andcommitted
[dartdev] Run remote empty version
Fixes: #62122 Change-Id: Id8331c58d968b6c92cfe7c1ae9be75d80260e772 Cq-Include-Trybots: luci.dart.try:pkg-mac-release-try,pkg-mac-release-arm64-try,pkg-win-release-try,pkg-linux-release-try,pkg-linux-debug-try Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/467803 Reviewed-by: Sigurd Meldgaard <[email protected]> Commit-Queue: Daco Harkes <[email protected]>
1 parent 27f26e5 commit 10373c3

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

pkg/dartdev/lib/src/commands/run.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -707,6 +707,9 @@ Enables running executables from remote packages.
707707
?.split(_colonButNoSlashes)
708708
.first ??
709709
'any';
710+
if (versionConstraint.isEmpty) {
711+
versionConstraint = 'any';
712+
}
710713
case RemoteSourceKind.path:
711714
throw StateError('Unreachable');
712715
}

pkg/dartdev/test/native_assets/run_remote_test.dart

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,11 @@ void main() async {
8989
);
9090
});
9191

92-
for (final withVersion in [false, true]) {
93-
test('dart run hosted package${withVersion ? ' with version' : ''}',
94-
timeout: longTimeout, () async {
92+
for (final version in ['', '@$_packageVersion', '@']) {
93+
final testName = version == ''
94+
? 'no version'
95+
: (version == '@' ? 'empty version' : 'with version');
96+
test('dart run hosted package $testName', timeout: longTimeout, () async {
9597
await inTempDir((tempUri) async {
9698
final dartDataHome = tempUri.resolve('dart_home/');
9799
await Directory.fromUri(dartDataHome).create();
@@ -103,7 +105,6 @@ void main() async {
103105
'${binDir.path}$_pathEnvVarSeparator${Platform.environment['PATH']!}',
104106
};
105107

106-
var version = withVersion ? '@$_packageVersion' : '';
107108
final runResult = await _runDartdev(
108109
fromDartdevSource,
109110
'run',

0 commit comments

Comments
 (0)