Fix line parsing logic
This commit is contained in:
Родитель
330ee2e88f
Коммит
981a9af1a3
|
@ -149,9 +149,9 @@ suite('DotnetCoreAcquisitionExtension End to End', function()
|
|||
let dotnetPaths: string[] = [];
|
||||
for (const version of versions) {
|
||||
const result = await vscode.commands.executeCommand<IDotnetAcquireResult>('dotnet.acquire', { version, requestingExtensionId, mode: installMode });
|
||||
assert.exists(result);
|
||||
assert.exists(result!.dotnetPath);
|
||||
assert.include(result!.dotnetPath, version);
|
||||
assert.exists(result, 'acquire command returned a result/success');
|
||||
assert.exists(result!.dotnetPath, 'the result has a path');
|
||||
assert.include(result!.dotnetPath, version, 'the path includes the version');
|
||||
if (result!.dotnetPath) {
|
||||
dotnetPaths = dotnetPaths.concat(result!.dotnetPath);
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ export class GenericDistroSDKProvider extends IDistroDotnetSDKProvider
|
|||
{
|
||||
const splitLine = line.split(/\s+/);
|
||||
// list sdk lines shows in the form: version [path], so the version is the 2nd item
|
||||
if(splitLine.length === 2)
|
||||
if(splitLine.length === 2 && splitLine[0] !== '')
|
||||
{
|
||||
versions.push(splitLine[0]);
|
||||
}
|
||||
|
|
|
@ -32,6 +32,16 @@ Command 'dotnet' not found, but can be installed with:
|
|||
|
||||
suite('Linux Distro Logic Unit Tests', () =>
|
||||
{
|
||||
test('Recommends Correct Version', async () => {
|
||||
if(shouldRun)
|
||||
{
|
||||
const recVersion = await provider.getRecommendedDotnetVersion(installType);
|
||||
assert.equal(mockExecutor.attemptedCommand, 'apt-cache search --names-only ^dotnet-sdk-9.0$', 'Searched for the newest package last with regex'); // this may fail if test not exec'd first
|
||||
// the data is cached so --version may not be executed.
|
||||
assert.equal(recVersion, '8.0.1xx', 'Resolved the most recent available version : will eventually break if the mock data is not updated');
|
||||
}
|
||||
}).timeout(standardTimeoutTime);
|
||||
|
||||
test('Package Check Succeeds', async () => {
|
||||
if(shouldRun)
|
||||
{
|
||||
|
@ -123,15 +133,6 @@ Microsoft.NETCore.App 7.0.5 [/usr/lib/dotnet/shared/Microsoft.NETCore.App]`, std
|
|||
}
|
||||
}).timeout(standardTimeoutTime);
|
||||
|
||||
test('Recommends Correct Version', async () => {
|
||||
if(shouldRun)
|
||||
{
|
||||
const recVersion = await provider.getRecommendedDotnetVersion(installType);
|
||||
assert.equal(mockExecutor.attemptedCommand, 'dotnet --version', 'Searched for the newest package last with regex');
|
||||
assert.equal(recVersion, '8.0.1xx', 'Resolved the most recent available version : will eventually break if the mock data is not updated');
|
||||
}
|
||||
}).timeout(standardTimeoutTime);
|
||||
|
||||
test('Gives Correct Version Support Info', async () => {
|
||||
if(shouldRun)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче