(programPath: string, tests: TestSelection[], shouldRunTestByLine: boolean)
| 98 | } |
| 99 | |
| 100 | export function getTestExecutionInfo(programPath: string, tests: TestSelection[], shouldRunTestByLine: boolean): { programUri: URI, args: string[] } { |
| 101 | if (shouldRunTestByLine && tests.length && tests.every((test) => test.position)) { |
| 102 | return { |
| 103 | // VS Code lines are 0-based, but Dart is 1-based. |
| 104 | args: tests.slice(1).map(((test) => `${programPath}?line=${test.position!.line + 1}`)), |
| 105 | programUri: URI.file(programPath).with({ query: `?line=${tests[0].position!.line + 1}` }), |
| 106 | }; |
| 107 | } |
| 108 | return { |
| 109 | args: ["--name", makeRegexForTests(tests)], |
| 110 | programUri: URI.file(programPath), |
| 111 | }; |
| 112 | } |
| 113 | |
| 114 | export function getProgramString(programUri: URI) { |
| 115 | return programUri.query ? `${fsPath(programUri)}${programUri.query}` : fsPath(programUri); |
no test coverage detected