import { describe, expect, it } from 'vitest' import { parseSzFiles } from '../../src/utils/zmodemSftpBridge' describe('parseSzFiles', () => { it('parses simple sz command', () => { expect(parseSzFiles('sz app.log\r')).toEqual(['app.log']) }) it('parses multiple files and skips flags', () => { expect(parseSzFiles('sz -y a.txt b.bin\n')).toEqual(['a.txt', 'b.bin']) }) it('uses the latest command line', () => { expect(parseSzFiles('sz old\rsz newer.tar.gz\r')).toEqual(['newer.tar.gz']) }) it('returns empty when no sz command', () => { expect(parseSzFiles('ls\rrz\r')).toEqual([]) }) it('strips bracketed-paste markers', () => { expect(parseSzFiles('\x1b[200~sz report.txt\x1b[201~\r')).toEqual(['report.txt']) }) })