(t *testing.T)
| 207 | } |
| 208 | |
| 209 | func 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 | |
| 222 | func BenchmarkUniqueInts(b *testing.B) { |
| 223 | // Create a slice with duplicates |