mirror of
https://github.com/ipfs/kubo.git
synced 2025-05-17 23:16:11 +08:00
18 lines
313 B
Go
18 lines
313 B
Go
package main
|
|
|
|
import (
|
|
"os/exec"
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestExample(t *testing.T) {
|
|
out, err := exec.Command("go", "run", "main.go").Output()
|
|
if err != nil {
|
|
t.Fatalf("running example (%v)", err)
|
|
}
|
|
if !strings.Contains(string(out), "All done!") {
|
|
t.Errorf("example did not run successfully")
|
|
}
|
|
}
|