MCPcopy
hub / github.com/bettercap/bettercap / TestExecWithOutput

Function TestExecWithOutput

core/core_test.go:209–220  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

207}
208
209func TestExecWithOutput(t *testing.T) {
210 // Test that Exec properly captures and trims output
211 if HasBinary("printf") {
212 output, err := Exec("printf", []string{" hello world \n"})
213 if err != nil {
214 t.Fatalf("unexpected error: %v", err)
215 }
216 if output != "hello world" {
217 t.Errorf("expected trimmed output 'hello world', got %q", output)
218 }
219 }
220}
221
222func BenchmarkUniqueInts(b *testing.B) {
223 // Create a slice with duplicates

Callers

nothing calls this directly

Calls 2

HasBinaryFunction · 0.85
ExecFunction · 0.85

Tested by

no test coverage detected