(data string)
| 353 | } |
| 354 | |
| 355 | func (c *testContext) SendStdin(data string) { |
| 356 | t := c.T |
| 357 | t.Helper() |
| 358 | c.lock.Lock() |
| 359 | defer c.lock.Unlock() |
| 360 | if c.channel == nil { |
| 361 | t.Fatalf("No channel opened.") |
| 362 | } |
| 363 | t.Logf("Sending stdin data...") |
| 364 | |
| 365 | if _, err := c.channel.Write([]byte(data)); err != nil { |
| 366 | t.Fatalf("Failed to send stdin data (%v)", err) |
| 367 | } |
| 368 | |
| 369 | t.Logf("Sent stdin data.") |
| 370 | } |
| 371 | |
| 372 | func (c *testContext) CloseChannel() { |
| 373 | t := c.T |