feat: Pro 买断门禁、SFTP 精简与批量多机改造
新增 entitlement/license IPC 与 Waffo 一次性结账服务骨架,挂载 AI/转发/代理/串口/广播/批量导入导出门禁;批量执行改为结果矩阵并复用连接池,SFTP 工具栏图标化并去掉已连接条,同时完善跨平台本地终端与窗口配置。 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
101d2164b4
commit
fea6d8db04
72 files changed
+3307
-396
No files matched your search
@@ -0,0 +1,54 @@
|
||||
import { describe, expect, it } from 'vitest'
|
||||
import { isWindowsLocalPath, joinLocalPath, parentPath, splitPathSegments } from '../../src/utils/localPath'
|
||||
import { fallbackLocalShells, localShellEnterKey } from '../../src/utils/platformShells'
|
||||
|
||||
describe('localPath', () => {
|
||||
it('detects windows paths', () => {
|
||||
expect(isWindowsLocalPath('C:\\Users\\a')).toBe(true)
|
||||
expect(isWindowsLocalPath('D:/tmp')).toBe(true)
|
||||
expect(isWindowsLocalPath('/home/a')).toBe(false)
|
||||
})
|
||||
|
||||
it('computes windows parents without collapsing to /', () => {
|
||||
expect(parentPath('C:\\Users\\logan\\docs', true)).toBe('C:\\Users\\logan')
|
||||
expect(parentPath('C:\\Users', true)).toBe('C:\\')
|
||||
expect(parentPath('C:\\', true)).toBe('C:\\')
|
||||
})
|
||||
|
||||
it('splits windows breadcrumbs with drive root', () => {
|
||||
const segments = splitPathSegments('C:\\Users\\logan', true)
|
||||
expect(segments.root).toBe('C:\\')
|
||||
expect(segments.parts).toEqual(['Users', 'logan'])
|
||||
expect(segments.join(['Users'])).toBe('C:\\Users')
|
||||
})
|
||||
|
||||
it('keeps posix remote parents', () => {
|
||||
expect(parentPath('/var/log', false)).toBe('/var')
|
||||
expect(parentPath('/', false)).toBe('/')
|
||||
})
|
||||
|
||||
it('joins local paths with platform separators', () => {
|
||||
expect(joinLocalPath('C:\\Users', 'a.txt')).toBe('C:\\Users\\a.txt')
|
||||
expect(joinLocalPath('/home/a', 'b.txt')).toBe('/home/a/b.txt')
|
||||
})
|
||||
})
|
||||
|
||||
describe('platformShells', () => {
|
||||
it('returns windows shells for windows platform', () => {
|
||||
const shells = fallbackLocalShells('windows')
|
||||
expect(shells.some((shell) => shell.kind === 'cmd')).toBe(true)
|
||||
expect(shells.some((shell) => shell.kind === 'pwsh')).toBe(true)
|
||||
})
|
||||
|
||||
it('defaults linux to bash', () => {
|
||||
const shells = fallbackLocalShells('linux')
|
||||
expect(shells[0]?.kind).toBe('bash')
|
||||
expect(shells[0]?.isDefault).toBe(true)
|
||||
})
|
||||
|
||||
it('uses CRLF enter for windows shells', () => {
|
||||
expect(localShellEnterKey('cmd')).toBe('\r\n')
|
||||
expect(localShellEnterKey('pwsh')).toBe('\r\n')
|
||||
expect(localShellEnterKey('bash')).toBe('\n')
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user