|
| 1 | +const assert = require('node:assert/strict') |
| 2 | +const { describe, test } = require('node:test') |
| 3 | +const getArgumentsForPosition = require('./get-args.js') |
| 4 | + |
| 5 | +describe('getArgumentsForPosition', () => { |
| 6 | + test('should format arguments for Visual Studio (devenv)', () => { |
| 7 | + const result = getArgumentsForPosition('devenv.exe', 'test.js', 10, 5) |
| 8 | + assert.deepEqual(result, ['/edit', 'test.js']) |
| 9 | + }) |
| 10 | + |
| 11 | + test('should format arguments for Visual Studio (visualstudio)', () => { |
| 12 | + const result = getArgumentsForPosition('visualstudio', 'src/app.js', 42, 12) |
| 13 | + assert.deepEqual(result, ['/edit', 'src/app.js']) |
| 14 | + }) |
| 15 | + |
| 16 | + test('should format arguments for Visual Studio with default column', () => { |
| 17 | + const result = getArgumentsForPosition('devenv.exe', 'main.cpp', 100) |
| 18 | + assert.deepEqual(result, ['/edit', 'main.cpp']) |
| 19 | + }) |
| 20 | + |
| 21 | + test('should format arguments for VS Code for comparison', () => { |
| 22 | + const result = getArgumentsForPosition('code.exe', 'test.js', 10, 5) |
| 23 | + assert.deepEqual(result, ['-r', '-g', 'test.js:10:5']) |
| 24 | + }) |
| 25 | + |
| 26 | + test('should format arguments for Notepad++ for comparison', () => { |
| 27 | + const result = getArgumentsForPosition('notepad++.exe', 'test.txt', 15, 8) |
| 28 | + assert.deepEqual(result, ['-n15', '-c8', 'test.txt']) |
| 29 | + }) |
| 30 | +}) |
0 commit comments