mirror of
https://github.com/ipfs/kubo.git
synced 2025-09-11 07:03:32 +08:00

- Modified Godeps/Godeps.json by hand - [TEST] Updated welcome docs hash to sharness - [TEST] Updated contact doc - [TEST] disabled breaking test (t0080-repo refs local)
29 lines
566 B
Go
29 lines
566 B
Go
package util
|
|
|
|
import (
|
|
"errors"
|
|
"testing"
|
|
|
|
context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
|
|
)
|
|
|
|
func TestLogErrorDoesNotBlockWhenCtxIsNotSetUpForLogging(t *testing.T) {
|
|
ctx := context.Background()
|
|
LogError(ctx, errors.New("ignore me"))
|
|
}
|
|
|
|
func TestLogErrorReceivedByParent(t *testing.T) {
|
|
|
|
expected := errors.New("From child to parent")
|
|
|
|
ctx, errs := ContextWithErrorLog(context.Background())
|
|
|
|
go func() {
|
|
LogError(ctx, expected)
|
|
}()
|
|
|
|
if err := <-errs; err != expected {
|
|
t.Fatal("didn't receive the expected error")
|
|
}
|
|
}
|