kubo/cmd/ipfs2/main_test.go
Brian Tiger Chow c5e75f91a6 tests(2/main) errClient
Discovered this quirk about interfaces.

@whyrusleeping
@mappum
@jbenet

License: MIT
Signed-off-by: Brian Tiger Chow <brian@perfmode.com>
2014-11-14 03:20:07 -08:00

18 lines
358 B
Go

package main
import (
"testing"
"github.com/jbenet/go-ipfs/commands"
)
func TestIsCientErr(t *testing.T) {
t.Log("Catch both pointers and values")
if !isClientError(commands.Error{Code: commands.ErrClient}) {
t.Errorf("misidentified value")
}
if !isClientError(&commands.Error{Code: commands.ErrClient}) {
t.Errorf("misidentified pointer")
}
}