Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test command: filename as string instead of package name #169

Merged
merged 1 commit into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion client/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export const runTest = ([filter, file, describe, test]: [string|null, string|nul
wollokCLITask('run tests', 'Wollok run test', [
'test',
...filter ? [`${asShellString(filter)}`] : [],
...file ? ['-f', file] : [],
...file ? ['-f', asShellString(file)] : [],
...describe ? ['-d', `${asShellString(describe)}`] : [],
...test ? ['-t', `${asShellString(test)}`] : [],
'--skipValidations',
Expand Down
6 changes: 3 additions & 3 deletions client/src/test/code-lens.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ suite('Should do code lenses', () => {
{
title: 'Run all tests',
command: 'wollok.run.test',
arguments: [null, 'test', null, null],
arguments: [null, 'test.wtest', null, null],
},
),
new CodeLens(
new Range(new Position(0, 0), new Position(4, 1)),
{
title: 'Run describe',
command: 'wollok.run.test',
arguments: [null, 'test', 'pepita test', null],
arguments: [null, 'test.wtest', 'pepita test', null],
},
),
new CodeLens(
new Range(new Position(1, 4), new Position(4, 0)),
{
title: 'Run test',
command: 'wollok.run.test',
arguments: [null, 'test', 'pepita test', 'pepita is happy'],
arguments: [null, 'test.wtest', 'pepita test', 'pepita is happy'],
},
),
])
Expand Down
4 changes: 2 additions & 2 deletions client/src/test/commands.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ suite('Should run commands', () => {

suite('run tests', () => {
const SEP = '<SEP>'
const testCommandOptions = `-f tests -d ${SEP}tests de pepita${SEP} -t ${SEP}something${SEP}`
const testCommandOptions = `-f ${SEP}tests.wtest${SEP} -d ${SEP}tests de pepita${SEP} -t ${SEP}something${SEP}`

const testArgs: [string, string, string, string] = [null, 'tests', 'tests de pepita', 'something']
const testArgs: [string, string, string, string] = [null, 'tests.wtest', 'tests de pepita', 'something']

async function runCommandOnPlatform(
platform: string,
Expand Down
6 changes: 3 additions & 3 deletions server/src/functionalities/code-lens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ const isTesteable = (node: Node): node is Test | Describe =>
const isWollokDefinition = (node: Node): node is Class | Singleton =>
node.is(Class) || node.is(Singleton)

const buildRunAllTestsCodeLens = (file: Package): CodeLens =>
const buildRunAllTestsCodeLens = (file: Package): CodeLens =>
buildTestsCodeLens(
Range.create(Position.create(0, 0), Position.create(0, 0)),
'wollok.run.test',
'Run all tests',
[null, file.name, null, null]
[null, file.fileName!, null, null]
)


Expand All @@ -75,7 +75,7 @@ const buildTestCodeLens = (file: Package, node: Test | Describe): CodeLens => {
`Run ${node.is(Test) ? 'test' : 'describe'}`,
[
null,
file.name,
file.fileName!,
describe ? removeQuotes(describe) : null,
test ? removeQuotes(test) : null,
]
Expand Down
Loading