mirror of
				https://github.com/rust-lang/rust-analyzer.git
				synced 2025-10-31 20:09:01 +00:00 
			
		
		
		
	 445b4fc27f
			
		
	
	
		445b4fc27f
		
	
	
	
	
		
			
			see: - https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/consistent-type-imports.md - https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-import-type-side-effects.md
		
			
				
	
	
		
			99 lines
		
	
	
	
		
			3.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			99 lines
		
	
	
	
		
			3.1 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import * as assert from "assert";
 | |
| import { Cargo } from "../../src/toolchain";
 | |
| import type { Context } from ".";
 | |
| 
 | |
| export async function getTests(ctx: Context) {
 | |
|     await ctx.suite("Launch configuration/Lens", (suite) => {
 | |
|         suite.addTest("A binary", async () => {
 | |
|             const args = Cargo.artifactSpec([
 | |
|                 "build",
 | |
|                 "--package",
 | |
|                 "pkg_name",
 | |
|                 "--bin",
 | |
|                 "pkg_name",
 | |
|             ]);
 | |
| 
 | |
|             assert.deepStrictEqual(args.cargoArgs, [
 | |
|                 "build",
 | |
|                 "--package",
 | |
|                 "pkg_name",
 | |
|                 "--bin",
 | |
|                 "pkg_name",
 | |
|                 "--message-format=json",
 | |
|             ]);
 | |
|             assert.deepStrictEqual(args.filter, undefined);
 | |
|         });
 | |
| 
 | |
|         suite.addTest("One of Multiple Binaries", async () => {
 | |
|             const args = Cargo.artifactSpec(["build", "--package", "pkg_name", "--bin", "bin1"]);
 | |
| 
 | |
|             assert.deepStrictEqual(args.cargoArgs, [
 | |
|                 "build",
 | |
|                 "--package",
 | |
|                 "pkg_name",
 | |
|                 "--bin",
 | |
|                 "bin1",
 | |
|                 "--message-format=json",
 | |
|             ]);
 | |
|             assert.deepStrictEqual(args.filter, undefined);
 | |
|         });
 | |
| 
 | |
|         suite.addTest("A test", async () => {
 | |
|             const args = Cargo.artifactSpec(["test", "--package", "pkg_name", "--lib", "--no-run"]);
 | |
| 
 | |
|             assert.deepStrictEqual(args.cargoArgs, [
 | |
|                 "test",
 | |
|                 "--package",
 | |
|                 "pkg_name",
 | |
|                 "--lib",
 | |
|                 "--no-run",
 | |
|                 "--message-format=json",
 | |
|             ]);
 | |
|             assert.notDeepStrictEqual(args.filter, undefined);
 | |
|         });
 | |
|     });
 | |
| 
 | |
|     await ctx.suite("Launch configuration/QuickPick", (suite) => {
 | |
|         suite.addTest("A binary", async () => {
 | |
|             const args = Cargo.artifactSpec(["run", "--package", "pkg_name", "--bin", "pkg_name"]);
 | |
| 
 | |
|             assert.deepStrictEqual(args.cargoArgs, [
 | |
|                 "build",
 | |
|                 "--package",
 | |
|                 "pkg_name",
 | |
|                 "--bin",
 | |
|                 "pkg_name",
 | |
|                 "--message-format=json",
 | |
|             ]);
 | |
|             assert.deepStrictEqual(args.filter, undefined);
 | |
|         });
 | |
| 
 | |
|         suite.addTest("One of Multiple Binaries", async () => {
 | |
|             const args = Cargo.artifactSpec(["run", "--package", "pkg_name", "--bin", "bin2"]);
 | |
| 
 | |
|             assert.deepStrictEqual(args.cargoArgs, [
 | |
|                 "build",
 | |
|                 "--package",
 | |
|                 "pkg_name",
 | |
|                 "--bin",
 | |
|                 "bin2",
 | |
|                 "--message-format=json",
 | |
|             ]);
 | |
|             assert.deepStrictEqual(args.filter, undefined);
 | |
|         });
 | |
| 
 | |
|         suite.addTest("A test", async () => {
 | |
|             const args = Cargo.artifactSpec(["test", "--package", "pkg_name", "--lib"]);
 | |
| 
 | |
|             assert.deepStrictEqual(args.cargoArgs, [
 | |
|                 "test",
 | |
|                 "--package",
 | |
|                 "pkg_name",
 | |
|                 "--lib",
 | |
|                 "--message-format=json",
 | |
|                 "--no-run",
 | |
|             ]);
 | |
|             assert.notDeepStrictEqual(args.filter, undefined);
 | |
|         });
 | |
|     });
 | |
| }
 |