Skip to content

Commit

Permalink
Merge pull request #169 from uqbar-project/fix-test-file-param
Browse files Browse the repository at this point in the history
Test command: filename as string instead of package name
  • Loading branch information
ivojawer authored Jun 19, 2024
2 parents 42ea358 + 3dbede1 commit 5de15d2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
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

0 comments on commit 5de15d2

Please sign in to comment.