2020-05-20 18:03:49 +00:00
|
|
|
import * as assert from 'assert';
|
2020-05-31 02:13:08 +00:00
|
|
|
import { Cargo } from '../../src/toolchain';
|
2020-05-20 18:03:49 +00:00
|
|
|
|
|
|
|
suite('Launch configuration', () => {
|
|
|
|
|
|
|
|
suite('Lens', () => {
|
|
|
|
test('A binary', async () => {
|
2020-05-31 02:13:08 +00:00
|
|
|
const args = Cargo.artifactSpec(["build", "--package", "pkg_name", "--bin", "pkg_name"]);
|
2020-05-20 18:03:49 +00:00
|
|
|
|
|
|
|
assert.deepEqual(args.cargoArgs, ["build", "--package", "pkg_name", "--bin", "pkg_name", "--message-format=json"]);
|
|
|
|
assert.deepEqual(args.filter, undefined);
|
|
|
|
});
|
|
|
|
|
|
|
|
test('One of Multiple Binaries', async () => {
|
2020-05-31 02:13:08 +00:00
|
|
|
const args = Cargo.artifactSpec(["build", "--package", "pkg_name", "--bin", "bin1"]);
|
2020-05-20 18:03:49 +00:00
|
|
|
|
|
|
|
assert.deepEqual(args.cargoArgs, ["build", "--package", "pkg_name", "--bin", "bin1", "--message-format=json"]);
|
|
|
|
assert.deepEqual(args.filter, undefined);
|
|
|
|
});
|
|
|
|
|
|
|
|
test('A test', async () => {
|
2020-05-31 02:13:08 +00:00
|
|
|
const args = Cargo.artifactSpec(["test", "--package", "pkg_name", "--lib", "--no-run"]);
|
2020-05-20 18:03:49 +00:00
|
|
|
|
|
|
|
assert.deepEqual(args.cargoArgs, ["test", "--package", "pkg_name", "--lib", "--no-run", "--message-format=json"]);
|
|
|
|
assert.notDeepEqual(args.filter, undefined);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
suite('QuickPick', () => {
|
|
|
|
test('A binary', async () => {
|
2020-05-31 02:13:08 +00:00
|
|
|
const args = Cargo.artifactSpec(["run", "--package", "pkg_name", "--bin", "pkg_name"]);
|
2020-05-20 18:03:49 +00:00
|
|
|
|
|
|
|
assert.deepEqual(args.cargoArgs, ["build", "--package", "pkg_name", "--bin", "pkg_name", "--message-format=json"]);
|
|
|
|
assert.deepEqual(args.filter, undefined);
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
test('One of Multiple Binaries', async () => {
|
2020-05-31 02:13:08 +00:00
|
|
|
const args = Cargo.artifactSpec(["run", "--package", "pkg_name", "--bin", "bin2"]);
|
2020-05-20 18:03:49 +00:00
|
|
|
|
|
|
|
assert.deepEqual(args.cargoArgs, ["build", "--package", "pkg_name", "--bin", "bin2", "--message-format=json"]);
|
|
|
|
assert.deepEqual(args.filter, undefined);
|
|
|
|
});
|
|
|
|
|
|
|
|
test('A test', async () => {
|
2020-05-31 02:13:08 +00:00
|
|
|
const args = Cargo.artifactSpec(["test", "--package", "pkg_name", "--lib"]);
|
2020-05-20 18:03:49 +00:00
|
|
|
|
|
|
|
assert.deepEqual(args.cargoArgs, ["test", "--package", "pkg_name", "--lib", "--message-format=json", "--no-run"]);
|
|
|
|
assert.notDeepEqual(args.filter, undefined);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|