feat: publish CodexPi contest snapshot
Some checks are pending
Qualité / tests (push) Waiting to run
Some checks are pending
Qualité / tests (push) Waiting to run
This commit is contained in:
20
frontend/tests/commandLine.test.ts
Normal file
20
frontend/tests/commandLine.test.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
|
||||
import { parseCommandLine } from '../src/commandLine.ts'
|
||||
|
||||
test('quoted arguments retain their spaces',()=>{
|
||||
assert.deepEqual(parseCommandLine('pytest "tests/my feature.py" -k \'works here\''),['pytest','tests/my feature.py','-k','works here'])
|
||||
})
|
||||
|
||||
test('escaped spaces and empty quoted arguments are retained',()=>{
|
||||
assert.deepEqual(parseCommandLine('tool one\\ two ""'),['tool','one two',''])
|
||||
})
|
||||
|
||||
test('windows paths are not damaged by parsing',()=>{
|
||||
assert.deepEqual(parseCommandLine('py "C:\\Mes Tests\\test.py"'),['py','C:\\Mes Tests\\test.py'])
|
||||
})
|
||||
|
||||
test('an unclosed quote is rejected',()=>{
|
||||
assert.throws(()=>parseCommandLine('pytest "tests/file.py'),/Guillemet non fermé/)
|
||||
})
|
||||
Reference in New Issue
Block a user