Add a bunch of shell tool commands

This commit is contained in:
Alex Gleason committed 2025-09-09 19:30:06 -05:00
1 parent a8c021411b
commit 7cbcd03c10
19 files changed
+1710 -45

No files matched your search

+49
View File
@@ -0,0 +1,49 @@
import { describe, it, expect, beforeEach } from 'vitest';
import { EchoCommand } from './echo';
describe('EchoCommand', () => {
let echoCommand: EchoCommand;
const testCwd = '/test/dir';
beforeEach(() => {
echoCommand = new EchoCommand();
});
it('should have correct command properties', () => {
expect(echoCommand.name).toBe('echo');
expect(echoCommand.description).toBe('Display text');
expect(echoCommand.usage).toBe('echo [text...]');
});
it('should echo single argument', async () => {
const result = await echoCommand.execute(['hello'], testCwd);
expect(result.exitCode).toBe(0);
expect(result.stdout).toBe('hello\n');
expect(result.stderr).toBe('');
});
it('should echo multiple arguments with spaces', async () => {
const result = await echoCommand.execute(['hello', 'world', 'test'], testCwd);
expect(result.exitCode).toBe(0);
expect(result.stdout).toBe('hello world test\n');
expect(result.stderr).toBe('');
});
it('should handle empty arguments', async () => {
const result = await echoCommand.execute([], testCwd);
expect(result.exitCode).toBe(0);
expect(result.stdout).toBe('\n');
expect(result.stderr).toBe('');
});
it('should handle arguments with special characters', async () => {
const result = await echoCommand.execute(['hello!', '@world', '#test'], testCwd);
expect(result.exitCode).toBe(0);
expect(result.stdout).toBe('hello! @world #test\n');
expect(result.stderr).toBe('');
});
});