mirror of
https://github.com/stablyai/orca.git
synced 2026-10-30 16:47:34 +00:00
20 lines
774 B
TypeScript
20 lines
774 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { claudeBashInputAsTypedCommand } from './claude-bash-input'
|
|
|
|
describe('claudeBashInputAsTypedCommand', () => {
|
|
it('restores the line as typed, keeping the space after `!`', () => {
|
|
expect(claudeBashInputAsTypedCommand('<bash-input> gcloud auth login</bash-input>')).toBe(
|
|
'! gcloud auth login'
|
|
)
|
|
expect(claudeBashInputAsTypedCommand('<bash-input>ls -la</bash-input>')).toBe('!ls -la')
|
|
})
|
|
it.each([
|
|
'run <bash-input>ls</bash-input>',
|
|
'<bash-input>ls</bash-input> and more',
|
|
'<bash-stdout>ok</bash-stdout>',
|
|
'<bash-input>a</bash-input><bash-input>b</bash-input>'
|
|
])('leaves anything else alone (%s)', (text) => {
|
|
expect(claudeBashInputAsTypedCommand(text)).toBeNull()
|
|
})
|
|
})
|