1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-05-17 23:16:11 +08:00
Files
Petar Maymounkov c9cc09f6f7 Cosmetic fixups in examples (#8325)
* test the examples in CI
* combine the two examples into a single one
2021-08-27 11:55:26 -04:00

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")
}
}