mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-30 04:05:36 +01:00
25 lines
451 B
Go
25 lines
451 B
Go
package main
|
|
|
|
import (
|
|
"bytes"
|
|
"fmt"
|
|
"os/exec"
|
|
"testing"
|
|
|
|
"github.com/ddworken/hishtory/shared"
|
|
)
|
|
|
|
func TestIntegration(t *testing.T) {
|
|
// Set up
|
|
defer shared.BackupAndRestore(t)
|
|
|
|
// Run the test
|
|
cmd := exec.Command("bash", "--init-file", "test_interaction.sh")
|
|
var out bytes.Buffer
|
|
cmd.Stdout = &out
|
|
if err := cmd.Run(); err != nil {
|
|
t.Fatalf("unexpected error when running test script: %v", err)
|
|
}
|
|
fmt.Printf("%q\n", out.String())
|
|
}
|