7 "github.com/stretchr/testify/require"
10func TestShellPerformanceComparison(t *testing.T) {
11 shell := NewShell(&Options{WorkingDir: t.TempDir()})
15 stdout, stderr, err := shell.Exec(t.Context(), "echo 'hello'")
16 exitCode := ExitCode(err)
17 duration := time.Since(start)
19 require.NoError(t, err)
20 require.Equal(t, 0, exitCode)
21 require.Contains(t, stdout, "hello")
22 require.Empty(t, stderr)
24 t.Logf("Quick command took: %v", duration)
27// Benchmark CPU usage during polling
28func BenchmarkShellPolling(b *testing.B) {
29 shell := NewShell(&Options{WorkingDir: b.TempDir()})
34 // Use a short sleep to measure polling overhead
35 _, _, err := shell.Exec(b.Context(), "sleep 0.02")
36 exitCode := ExitCode(err)
37 if err != nil || exitCode != 0 {
38 b.Fatalf("Command failed: %v, exit code: %d", err, exitCode)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list